comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
April 2008
motuwethfrsasuw
 123456 14
78910111213 15
14151617181920 16
21222324252627 17
282930     18
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Documentation of the ReportEvent function imprecise?         


Author: angel_tsankov
Date: Apr 25, 2008 06:13

Hallo!

The documentation of the ReportEvent function says:
The function returns ERROR_INVALID_HANDLE if lpSourceName specifies
the
Security event log.

However the flowing code sample (on Windows Server 2003 EE with SP2)
shows
that this is not the case:

#include
#include

int main()
{
HANDLE const h = RegisterEventSource(NULL, _T("Security")); //
Returns NULL
DWORD const err = GetLastError(); // Returns 5 (Access denied)
}

Can someone explain this discrepancy?

Regards,
Angel Tsankov
1 Comment