windows-nt/Source/XPSP1/NT/admin/netui/macprint/pstodib/lib/psdiblib.c
2020-09-26 16:20:57 +08:00

81 lines
1.4 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
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 <v-jimbr@microsoft.com 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;
}