HP Xw460c - ProLiant - Blade Workstation User Manual page 171

Remote graphics software 5.3.0 user guide
Hide thumbs Also See for Xw460c - ProLiant - Blade Workstation:
Table of Contents

Advertisement

// Set the pointer to our buffer. Strings and data will get appended
// to the EVENTLOGRECORD structure.
pevlr = (EVENTLOGRECORD *) &bBuffer;
// Read the event specified by dwEventNum
result = ReadEventLog(h,
EVENTLOG_SEEK_READ |
EVENTLOG_FORWARDS_READ, // advance forward
dwEventNum,
pevlr,
BUFFER_SIZE,
&dwRead,
&dwNeeded);
if (CloseEventLog(h) == false)
{
... report error status ...
return true;
}
//
Process event (example: print out event) ==============================
if (result)
{
// We only know how to process specific events
if (pevlr->EventID == RGSENDER_CONNECT_STATE)
{
// Retrieve the two UINT32 fields of this message
// representing primary and non-primary connections.
unsigned int *pData = (unsigned int *)
((LPBYTE) pevlr + pevlr->DataOffset);
// Examine state of primary connections here for other
// agent response if number drops to zero...
... example only prints out retrieved record to console ...
printf ("Event: %u Primary: %u
dwEventNum, pData[0], pData[1]);
}
... Process other events here if desired ...
}
else
{
... report unrecognized event here ...
return true;
}
return false;
}
void monitorEvents(LPCTSTR eventServer, LPCTSTR eventSource, int seconds)
{
DWORD dwCurrentIndex = 0;
DWORD dwCurrentStart;
DWORD dwCurrentCount;
DWORD dwNewIndex;
int
waitedFor;
// This function will monitor the log for the specified number of
// seconds. If seconds is less than zero, we will wait forever.
for (waitedFor = 0; seconds < 0 || waitedFor < seconds; )
{
HANDLE h;
//
Open, read status of log, close event log =========================
if ((h = OpenEventLog(eventServer, eventSource)) == NULL)
{
... report error status here ...
return;
}
// event log handle
// start at specific event
// record to read
// pointer to buffer
// size of buffer
// number of bytes read
// bytes in next record
Secondary: %u\n",
Remote Application Termination 171

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents