MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / Record

Method Record

src/common/os/win32/fbsyslog.cpp:64–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62};
63
64void SyslogAccess::Record(WORD wType, const char* msg)
65{
66 EnterCriticalSection(&cs);
67 if (! InitFlag) {
68 InitFlag = true;
69 HINSTANCE hLib = LoadLibrary("Advapi32");
70 tRegisterEventSource *fRegisterEventSource = hLib ?
71 (tRegisterEventSource *) GetProcAddress(hLib, "RegisterEventSourceA") : 0;
72 fReportEvent = hLib ?
73 (tReportEvent *) GetProcAddress(hLib, "ReportEventA") : 0;
74 LogHandle = fRegisterEventSource && fReportEvent ?
75 fRegisterEventSource(0, "Firebird SQL Server") : 0;
76 }
77 bool use9x = true;
78 if (LogHandle) {
79 LPCTSTR sb[1];
80 sb[0] = msg;
81 if (fReportEvent(LogHandle, wType, 0, 0, 0, 1, 0, sb, 0)) {
82 use9x = false;
83 }
84 }
85 if (use9x) {
86 ::MessageBox(0, msg, "Firebird Error", MB_ICONSTOP);
87 }
88 LeaveCriticalSection(&cs);
89}
90
91Firebird::InitInstance<SyslogAccess> iSyslogAccess;
92

Callers

nothing calls this directly

Calls 2

EnterCriticalSectionFunction · 0.85
LeaveCriticalSectionFunction · 0.85

Tested by

no test coverage detected