Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
2.6 KiB

//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1994.
//
// File: notifyev.cxx
//
// Contents: CClientNotifyEvent class
//
// History: Jan-06-97 mohamedn Created
//
//--------------------------------------------------------------------------
#include <pch.cxx>
#pragma hdrstop
#include <eventlog.hxx>
#include <notifyev.hxx>
#include <cievtmsg.h> // CI_SERVICE_CATEGORY
//+------------------------------------------------------
//
// Member: CClientNotifyEvent::CClientNotifyEvent
//
//
// Synopsis: Consturctor encapsulates creating a CEventLogItem object,
// and calls CEventLog::ReportEvent on that event item.
//
// Arguments: [fType ] - Type of event
// [eventId] - Message file event identifier
// [nParams] - Number of substitution arguments being passed
// [aParams] - pointer to PROPVARIANT array of substitution args.
// [cbData ] - number of bytes in supplemental raw data.
// [data ] - pointer to block of supplemental data.
//
// History: Jan-06-97 mohamedn Created
//
//----------------------------------------------------------------------------
CClientNotifyEvent::CClientNotifyEvent( WORD fType,
DWORD eventId,
ULONG nParams,
const PROPVARIANT *aParams,
ULONG cbData,
void* data )
{
CEventLog eventLog(NULL,wcsCiEventSource);
CEventItem item(fType, CI_SERVICE_CATEGORY, eventId, (WORD) nParams, cbData, data);
for (WORD i = 0; i < nParams ; i++)
{
switch (aParams[i].vt)
{
case VT_LPSTR:
Win4Assert( FALSE );
break;
case VT_LPWSTR:
item.AddArg(aParams[i].pwszVal);
break;
case VT_UI4:
item.AddArg(aParams[i].ulVal);
break;
default:
Win4Assert( !"Default case hit in CClientNotifyEvent" );
THROW (CException(E_INVALIDARG));
} // switch
} // for
eventLog.ReportEvent(item);
}