if ((my_os_resource_handle = OpenSemaphore(SEMAPHORE_ALL_ACCESS,FALSE,"Global\\ABC32$SEMAPHORE$%c")) == NULL)
This function gets called many times.
For the first time in years, we have seen the problem in a particular system
This call failed three times over a span of two days and to get the program working, the entire system had to be rebooted.
The GetLastError always returned 2
Details of the system.
Windows 2003 Professional
Any thoughts on the same? .... is there any method that I can reproduce the File not available (Error code 2) situation so that I can understand more ....... in other words, are there any techniques to manipulate, access kernel objects ?
For the first time in years, we have seen the problem in a particular system. This call failed three times over a span of two days and to get the program working, the entire system had to be rebooted.
Well, there was a bug or if not a bug, an oversight in your program that finally became exposed.
1) As S_M_A pointed out, is your synchronization done correctly?
2) Do you check for all return values from all Windows API and other library functions?
One reason a lot of programs fail is that false assumptions are made when it comes to calling API functions. The belief is that the function will work, thereby no code is written to check for the return value (or exception if it's a C++ based API). Then that fateful day when these "safe" API function fails, the code reacts by doing nothing and proceeding as if the function didn't fail. Then things fall apart from there.