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.
 
 
 
 
 
 

81 lines
1.5 KiB

/*
Copyright (c) 1992,1993 Microsoft Corporation
Module Name:
psdiblib.c
Abstract:
This file contains some general functionality that is used by all the
PSTODIB components. Currently only a mechanism to log errors to the
event log exists.
Author:
James Bratsanos <[email protected] or mcrafts!jamesb>
Revision History:
6 Dec 1992 Initial Version
Notes: Tab stop: 4
--*/
#include <windows.h>
#include <stdio.h>
#include "psdiblib.h"
#include "debug.h"
VOID
PsLogEvent(
IN DWORD dwErrorCode,
IN WORD cStrings,
IN LPTSTR alptStrStrings[],
IN DWORD dwFlags )
{
HANDLE hLog;
PSID pSidUser = (PSID) NULL;
WORD wEventType;
hLog = RegisterEventSource( NULL, MACPRINT_EVENT_SOURCE );
if ( hLog != (HANDLE) NULL) {
if ( dwFlags & PSLOG_ERROR) {
wEventType = EVENTLOG_ERROR_TYPE;
} else {
wEventType = EVENTLOG_WARNING_TYPE;
}
ReportEvent( hLog,
wEventType,
EVENT_CATEGORY_PSTODIB, // event category
dwErrorCode,
pSidUser,
cStrings,
0,
alptStrStrings,
(PVOID)NULL
);
DeregisterEventSource( hLog );
} else{
//DJC
DBGOUT(("\nRegister Event is failing... returns %d",GetLastError()));
}
return;
}