Re: What causes "Too many posts were made to a semaphore"?

From: Jochen Kalmbach (nospam-Jochen.Kalmbach_at_holzma.de)
Date: 02/29/04


Date: Sun, 29 Feb 2004 12:09:56 -0800

Peter Steele wrote:

> Error no. 298, Too many posts were made to a semaphore.
>
> on a call to WaitForSingleObject(). This is happening on a Windows 2000
> system. What might be causing this failure?

The following code will produce this error:
  HANDLE hSem = CreateSemaphore(NULL, 0, 10, NULL);
  BOOL bRet = ReleaseSemaphore(hSem, 11, NULL);
  DWORD gle = GetLastError(); // => 298

As you can see the max value in the "Create" was 10,
Now we released with 11; which is greater than 10...

-- 
Greetings
  Jochen
 
   Do you need a memory-leak finder ?
   http://www.codeproject.com/tools/leakfinder.asp


Relevant Pages

  • Re: Failure audits generated by MS firewall
    ... Thanks, Bill. ... the problem that is causing my systems to generate Failure Audits. ... > Windows XP and Server security settings. ...
    (microsoft.public.windows.server.sbs)
  • RE: lsass.exe Failure audits on XP Clients
    ... I understand that the issue is there are some Failure ... Audit events logged in Windows XP. ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: HP zd7000 display problem
    ... The 'disc busy' light flickers on and off at all the ... when the Windows hibernation screen flickers on ... Failure", "Screen Dies", etc). ... less than a year (after the first repair, they sent the laptop back ...
    (comp.sys.laptops)
  • Re: Event viewer and security failure audit
    ... - Logon failure auditing is enabled. ... Windows will write event ID 529 to the log file ... despite the fact that the machine is using a local account. ... Event Type: Failure Audit ...
    (microsoft.public.windowsxp.general)
  • Re: Unable to open multiple browser windows
    ... Did you try BHO Demon? ... it might find a BHO that's causing this. ... Try toolbar Cop from http://www.mvps.org/sramesh2k/Toolkit.htm Backup the ... If that allows additional windows to ...
    (microsoft.public.windows.inetexplorer.ie6.browser)