rxwinsys.cpp File Reference
#include <windows.h>
#include "oorexxapi.h"
#include <stdio.h>
#include <string.h>
#include <ddeml.h>
#include <time.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <algorithm>
Include dependency graph for rxwinsys.cpp:

Go to the source code of this file.

Macros

#define STR_BUFFER   256
 
#define MAX_TIME_DATE   128
 
#define MAX_REGISTRY_KEY_SIZE   256
 
#define MSG_TIMEOUT   5000
 
#define MSG_TIMEOUT_OPTS   (SMTO_ABORTIFHUNG|SMTO_NORMAL)
 
#define INVALID_ROUTINE   40 /* Raise Rexx error */
 
#define VALID_ROUTINE   0 /* Successful completion */
 
#define CHECKARG(argexpctl, argexpcth)    if ((argc < argexpctl) || (argc > argexpcth)) return HandleArgError(retstr, (argc > argexpcth))
 
#define RETC(retcode)
 
#define RETERR
 
#define RETVAL(retvalue)
 
#define RET_HANDLE(retvalue)
 
#define GET_HKEY(argum, ghk)
 
#define GET_HANDLE(argum, ghk)   string2pointer(argum, (void **)&(ghk))
 
#define SET_VARIABLE(varname, data, retc)
 
#define GET_TYPE_INDEX(type, index)
 
#define IDS_REGISTRY_KEY_CURRENT_SHELLFOLDER   "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
 
#define IDS_CURRENT_DESKTOP   "Desktop"
 
#define IDS_REGISTRY_KEY_ALL_NT_SHELLFOLDER   "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
 
#define IDS_ALL_NT_DESKTOP   "Common Desktop"
 
#define IDS_REGISTRY_KEY_ALL_9x_SHELLFOLDER   ".DEFAULT\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
 
#define IDS_ALL_9x_DESKTOP   "Desktop"
 
#define WSEL_DEFAULT_EVENTS_ARRAY_SIZE   512
 
#define WSEL_DEFAULT_SOURCE   "Application"
 
#define HANDLE_ATTRIBUTE   "CURRENTHANDLE"
 
#define RECORDS_ATTRIBUTE   "EVENTS"
 
#define INITCODE_ATTRIBUTE   "INITCODE"
 
#define MIN_READ_BUFFER_ATTRIBUTE   "MINIMUMREADBUFFER"
 
#define MIN_READ_MIN_ATTRIBUTE   "MINIMUMREADMIN"
 
#define MIN_READ_MAX_ATTRIBUTE   "MINIMUMREADMAX"
 
#define MAX_RECORD_SIZE   256 * 1024
 
#define MAX_READ_KB_COUNT   256
 
#define MAX_READ_BUFFER   MAX_READ_KB_COUNT * 1024
 
#define MIN_READ_KB_COUNT   16
 
#define MIN_READ_BUFFER   MIN_READ_KB_COUNT * 1024
 
#define BAD_RECORD_ARRAY_MSG   "The events attribute has been altered so it is no longer an array object"
 
#define BAD_RECORD_START_MSG   "Requested start exceeds number of records"
 
#define TOO_SMALLBUFFER_MSG   "An event log record is too large (%u) for the read buffer (%u.)"
 
#define START_RECORD_OUT_OF_RANGE_MSG   "The start record (%u) is out of range; (%u - %u)"
 
#define END_RECORD_OUT_OF_RANGE_MSG   "start and count produce an end record (%u) out of range; (%u - %u)"
 

Enumerations

enum  LogNumberOp { record_count , oldest_record , youngest_record }
 

Functions

void memupper (char *location, size_t length)
 
VOID Little2BigEndian (BYTE *pbInt, INT iSize)
 
size_t dwordPtrToRexx (DWORD_PTR val, PRXSTRING r)
 
LONG HandleArgError (PRXSTRING r, BOOL ToMuch)
 
bool isHex (CSTRING value)
 
BOOL string2pointer (const char *string, void **pointer)
 
void pointer2string (PRXSTRING result, void *pointer)
 
BOOL IsRunningNT ()
 
void pointer2string (char *result, void *pointer)
 
RexxStringObject pointer2string (RexxMethodContext *c, void *pointer)
 
HKEY getParentKeyHandle (RexxMethodContext *c, CSTRING hkParent)
 
 RexxMethod0 (RexxObjectPtr, WSRegistry_init)
 
 RexxMethod0 (RexxObjectPtr, getCurrent_Key)
 
 RexxMethod1 (RexxObjectPtr, setCurrent_Key, RexxStringObject, regKeyHandle)
 
 RexxMethod0 (POINTERSTRING, getLocal_Machine)
 
 RexxMethod0 (POINTERSTRING, getCurrent_User)
 
 RexxMethod0 (POINTERSTRING, getUsers)
 
 RexxMethod0 (POINTERSTRING, getClasses_Root)
 
 RexxMethod0 (POINTERSTRING, getPerformance_Data)
 
 RexxMethod0 (POINTERSTRING, getCurrent_Config)
 
 RexxMethod2 (uint32_t, WSRegistry_delete, OPTIONAL_CSTRING, hkParent, CSTRING, subKeyName)
 
 RexxMethod3 (RexxObjectPtr, WSRegistry_open, OPTIONAL_CSTRING, hkParent, OPTIONAL_CSTRING, subKeyName, OPTIONAL_CSTRING, access)
 
size_t RexxEntry WSRegistryKey (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
size_t RexxEntry WSRegistryValue (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
size_t RexxEntry WSRegistryFile (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
HDDEDATA CALLBACK DDECallback (UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hDDEData, DWORD dwData1, DWORD dwData2)
 
BOOL ProgmanCmd (LPSTR lpszCmd)
 
BOOL AddPMGroup (const char *lpszGroup, const char *lpszPath)
 
BOOL DeletePMGroup (const char *lpszGroup)
 
BOOL ShowPMGroup (const char *lpszGroup, WORD wCmd)
 
BOOL AddPMItem (const char *lpszCmdLine, const char *lpszCaption, const char *lpszIconPath, WORD wIconIndex, const char *lpszDir, BOOL bLast, const char *lpszHotKey, const char *lpszModifier, BOOL bMin)
 
BOOL DeletePMItem (const char *lpszItem)
 
BOOL LeavePM (BOOL bSaveGroups)
 
BOOL GetCurrentUserDesktopLocation (LPBYTE szDesktopDir, LPDWORD lpcbData)
 
BOOL GetAllUserDesktopLocation (LPBYTE szDesktopDir, LPDWORD lpcbData)
 
BOOL AddPMDesktopIcon (const char *lpszName, const char *lpszProgram, const char *lpszIcon, int iIconIndex, const char *lpszWorkDir, const char *lpszLocation, const char *lpszArguments, int iScKey, int iScModifier, const char *lpszRun)
 
INT DelPMDesktopIcon (const char *lpszName, const char *lpszLocation)
 
size_t RexxEntry WSProgManager (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
void lookupMessageFile (char *pValueName, char *logName, char *source, char *fileBuffer)
 
BOOL findAndFormatDescription (char *files, DWORD msgID, char **ppInserts, LPVOID *lpMsgBuf)
 
void getEventDescription (PEVENTLOGRECORD pEvLogRecord, const char *pchSource, char **ppMessage)
 
char * getEventUserName (PEVENTLOGRECORD pEvLogRecord)
 
size_t getEventBinaryData (PEVENTLOGRECORD pEvLogRecord, char **ppBinData)
 
void systemServiceException (RexxMethodContext *context, char *msg)
 
void outOfMemoryException (RexxMethodContext *c)
 
void wrongArgValueException (RexxMethodContext *c, int pos, const char *list, RexxObjectPtr actual)
 
void wrongArgValueException (RexxMethodContext *c, int pos, const char *list, const char *actual)
 
unsigned int wrongClassException (RexxMethodContext *c, int pos, const char *n)
 
void setCurrentHandle (RexxMethodContext *context, HANDLE h)
 
HANDLE getCurrentHandle (RexxMethodContext *context)
 
DWORD getMinimumReadBufferSize (RexxMethodContext *c)
 
RexxArrayObject getRecordArray (RexxMethodContext *context)
 
bool getOpenEventLog (RexxMethodContext *context, const char *server, const char *source, HANDLE *pHandle, DWORD *pRC)
 
DWORD closeEventLog (RexxMethodContext *context)
 
int32_t getEventLogNumber (RexxMethodContext *context, LogNumberOp numberType, CSTRING server, CSTRING source)
 
bool checkReadRecordsArgs (RexxMethodContext *context, HANDLE hLog, CSTRING direction, uint32_t start, uint32_t *count, DWORD *flags, DWORD *rc)
 
bool isGoodEventType (uint16_t type)
 
 RexxMethod0 (int, WSEventLog_init)
 
 RexxMethod2 (uint32_t, WSEventLog_open, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source)
 
 RexxMethod2 (int32_t, WSEventLog_getNumber, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source)
 
 RexxMethod2 (int32_t, WSEventLog_getFirst, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source)
 
 RexxMethod2 (int32_t, WSEventLog_getLast, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source)
 
 RexxMethod2 (logical_t, WSEventLog_isFull, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source)
 
 RexxMethod3 (uint32_t, WSEventLog_clear, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source, OPTIONAL_CSTRING, backupFile)
 
 RexxMethod7 (uint32_t, WSEventLog_write, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source, OPTIONAL_uint16_t, t, OPTIONAL_uint16_t, category, OPTIONAL_uint32_t, id, OPTIONAL_RexxStringObject, rawData, ARGLIST, args)
 
 RexxMethod1 (int, WSEventLog_minimumReadSet, uint32_t, countKB)
 
 RexxMethod0 (uint32_t, WSEventLog_minimumReadGet)
 
 RexxMethod5 (uint32_t, WSEventLog_readRecords, OPTIONAL_CSTRING, direction, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source, OPTIONAL_uint32_t, start, OPTIONAL_uint32_t, count)
 
 RexxMethod1 (uint32_t, WSEventLog_getLogNames, RexxObjectPtr, obj)
 
 RexxMethod0 (uint32_t, WSEventLog_close)
 
 RexxMethod0 (uint32_t, WSEventLog_uninit)
 
 RexxMethod4 (int, WSEventLog_test, RexxStringObject, data, OPTIONAL_CSTRING, server, OPTIONAL_CSTRING, source, ARGLIST, args)
 
size_t RexxEntry WSCtrlWindow (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
size_t RexxEntry WSCtrlSend (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
size_t RexxEntry WSCtrlMenu (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
size_t RexxEntry WSClipboard (const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
 
size_t RexxEntry InstWinSysFuncs (const char *funcname, size_t argc, CONSTRXSTRING *argv, const char *qname, RXSTRING *retstr)
 
 OOREXX_GET_PACKAGE (rxwinsys)
 

Variables

RexxRoutineEntry rxwinsys_functions []
 
RexxMethodEntry rxwinsys_methods []
 
RexxPackageEntry rxwinsys_package_entry
 

Macro Definition Documentation

◆ BAD_RECORD_ARRAY_MSG

#define BAD_RECORD_ARRAY_MSG   "The events attribute has been altered so it is no longer an array object"

Definition at line 1815 of file rxwinsys.cpp.

◆ BAD_RECORD_START_MSG

#define BAD_RECORD_START_MSG   "Requested start exceeds number of records"

Definition at line 1816 of file rxwinsys.cpp.

◆ CHECKARG

#define CHECKARG (   argexpctl,
  argexpcth 
)     if ((argc < argexpctl) || (argc > argexpcth)) return HandleArgError(retstr, (argc > argexpcth))

Definition at line 111 of file rxwinsys.cpp.

◆ END_RECORD_OUT_OF_RANGE_MSG

#define END_RECORD_OUT_OF_RANGE_MSG   "start and count produce an end record (%u) out of range; (%u - %u)"

Definition at line 1819 of file rxwinsys.cpp.

◆ GET_HANDLE

#define GET_HANDLE (   argum,
  ghk 
)    string2pointer(argum, (void **)&(ghk))

Definition at line 162 of file rxwinsys.cpp.

◆ GET_HKEY

#define GET_HKEY (   argum,
  ghk 
)
Value:
{ \
ghk = NULL; \
if (strstr(argum,"MACHINE")) ghk = HKEY_LOCAL_MACHINE; else \
if (strstr(argum,"CLASSES")) ghk = HKEY_CLASSES_ROOT; else \
if (strstr(argum,"CURRENT_USER")) ghk = HKEY_CURRENT_USER; else \
if (strstr(argum,"USERS")) ghk = HKEY_USERS; else \
if (strstr(argum,"PERFORMANCE")) ghk = HKEY_PERFORMANCE_DATA; else \
if (strstr(argum,"CURRENT_CONFIG")) ghk = HKEY_CURRENT_CONFIG; else \
if (strstr(argum,"DYN_DATA")) ghk = HKEY_DYN_DATA; else \
string2pointer(argum, (void **)&ghk); \
}
BOOL string2pointer(const char *string, void **pointer)
Definition: rxwinsys.cpp:224

Definition at line 149 of file rxwinsys.cpp.

◆ GET_TYPE_INDEX

#define GET_TYPE_INDEX (   type,
  index 
)
Value:
{ \
switch (type) \
{ \
case EVENTLOG_ERROR_TYPE: \
index=0; \
break; \
case EVENTLOG_WARNING_TYPE: \
index=1; \
break; \
case EVENTLOG_INFORMATION_TYPE: \
index=2; \
break; \
case EVENTLOG_SUCCESS: \
index=2; \
break; \
case EVENTLOG_AUDIT_SUCCESS: \
index=3; \
break; \
case EVENTLOG_AUDIT_FAILURE: \
index=4; \
break; \
default: \
index=5; \
} \
}
int type
Definition: cmdparse.cpp:383

Definition at line 179 of file rxwinsys.cpp.

◆ HANDLE_ATTRIBUTE

#define HANDLE_ATTRIBUTE   "CURRENTHANDLE"

Definition at line 1799 of file rxwinsys.cpp.

◆ IDS_ALL_9x_DESKTOP

#define IDS_ALL_9x_DESKTOP   "Desktop"

Definition at line 1451 of file rxwinsys.cpp.

◆ IDS_ALL_NT_DESKTOP

#define IDS_ALL_NT_DESKTOP   "Common Desktop"

Definition at line 1448 of file rxwinsys.cpp.

◆ IDS_CURRENT_DESKTOP

#define IDS_CURRENT_DESKTOP   "Desktop"

Definition at line 1396 of file rxwinsys.cpp.

◆ IDS_REGISTRY_KEY_ALL_9x_SHELLFOLDER

#define IDS_REGISTRY_KEY_ALL_9x_SHELLFOLDER   ".DEFAULT\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"

Definition at line 1450 of file rxwinsys.cpp.

◆ IDS_REGISTRY_KEY_ALL_NT_SHELLFOLDER

#define IDS_REGISTRY_KEY_ALL_NT_SHELLFOLDER   "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"

Definition at line 1447 of file rxwinsys.cpp.

◆ IDS_REGISTRY_KEY_CURRENT_SHELLFOLDER

#define IDS_REGISTRY_KEY_CURRENT_SHELLFOLDER   "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"

Definition at line 1395 of file rxwinsys.cpp.

◆ INITCODE_ATTRIBUTE

#define INITCODE_ATTRIBUTE   "INITCODE"

Definition at line 1801 of file rxwinsys.cpp.

◆ INVALID_ROUTINE

#define INVALID_ROUTINE   40 /* Raise Rexx error */

Definition at line 90 of file rxwinsys.cpp.

◆ MAX_READ_BUFFER

#define MAX_READ_BUFFER   MAX_READ_KB_COUNT * 1024

Definition at line 1811 of file rxwinsys.cpp.

◆ MAX_READ_KB_COUNT

#define MAX_READ_KB_COUNT   256

Definition at line 1810 of file rxwinsys.cpp.

◆ MAX_RECORD_SIZE

#define MAX_RECORD_SIZE   256 * 1024

Definition at line 1807 of file rxwinsys.cpp.

◆ MAX_REGISTRY_KEY_SIZE

#define MAX_REGISTRY_KEY_SIZE   256

Definition at line 53 of file rxwinsys.cpp.

◆ MAX_TIME_DATE

#define MAX_TIME_DATE   128

Definition at line 50 of file rxwinsys.cpp.

◆ MIN_READ_BUFFER

#define MIN_READ_BUFFER   MIN_READ_KB_COUNT * 1024

Definition at line 1813 of file rxwinsys.cpp.

◆ MIN_READ_BUFFER_ATTRIBUTE

#define MIN_READ_BUFFER_ATTRIBUTE   "MINIMUMREADBUFFER"

Definition at line 1802 of file rxwinsys.cpp.

◆ MIN_READ_KB_COUNT

#define MIN_READ_KB_COUNT   16

Definition at line 1812 of file rxwinsys.cpp.

◆ MIN_READ_MAX_ATTRIBUTE

#define MIN_READ_MAX_ATTRIBUTE   "MINIMUMREADMAX"

Definition at line 1804 of file rxwinsys.cpp.

◆ MIN_READ_MIN_ATTRIBUTE

#define MIN_READ_MIN_ATTRIBUTE   "MINIMUMREADMIN"

Definition at line 1803 of file rxwinsys.cpp.

◆ MSG_TIMEOUT

#define MSG_TIMEOUT   5000

Definition at line 55 of file rxwinsys.cpp.

◆ MSG_TIMEOUT_OPTS

#define MSG_TIMEOUT_OPTS   (SMTO_ABORTIFHUNG|SMTO_NORMAL)

Definition at line 59 of file rxwinsys.cpp.

◆ RECORDS_ATTRIBUTE

#define RECORDS_ATTRIBUTE   "EVENTS"

Definition at line 1800 of file rxwinsys.cpp.

◆ RET_HANDLE

#define RET_HANDLE (   retvalue)
Value:
{ \
pointer2string(retstr, retvalue); \
return 0; \
}

Definition at line 138 of file rxwinsys.cpp.

◆ RETC

#define RETC (   retcode)
Value:
{ \
retstr->strlength = 1;\
if (retcode) retstr->strptr[0] = '1'; else retstr->strptr[0] = '0'; \
retstr->strptr[1] = '\0'; \
return 0; \
}

Definition at line 116 of file rxwinsys.cpp.

◆ RETERR

#define RETERR
Value:
{ \
retstr->strlength = 1;\
retstr->strptr[0] = '1'; \
retstr->strptr[1] = '\0'; \
return 40; \
}

Definition at line 123 of file rxwinsys.cpp.

◆ RETVAL

#define RETVAL (   retvalue)
Value:
{ \
itoa(retvalue, retstr->strptr, 10); \
retstr->strlength = strlen(retstr->strptr);\
return 0; \
}

Definition at line 131 of file rxwinsys.cpp.

◆ SET_VARIABLE

#define SET_VARIABLE (   varname,
  data,
  retc 
)
Value:
{\
shvb.shvnext = NULL; \
shvb.shvname.strptr = varname; \
shvb.shvname.strlength = strlen(varname); \
shvb.shvnamelen = shvb.shvname.strlength; \
shvb.shvvalue.strptr = data; \
shvb.shvvalue.strlength = strlen(data); \
shvb.shvvaluelen = strlen(data); \
shvb.shvcode = RXSHV_SYSET; \
shvb.shvret = 0; \
if (RexxVariablePool(&shvb) == RXSHV_BADN) RETC(retc); \
}
RexxReturnCode RexxEntry RexxVariablePool(PSHVBLOCK pshvblock)
#define RXSHV_BADN
Definition: rexxapidefs.h:116
#define RXSHV_SYSET
Definition: rexxapidefs.h:100
#define RETC(retcode)
Definition: rxwinsys.cpp:116

Definition at line 165 of file rxwinsys.cpp.

◆ START_RECORD_OUT_OF_RANGE_MSG

#define START_RECORD_OUT_OF_RANGE_MSG   "The start record (%u) is out of range; (%u - %u)"

Definition at line 1818 of file rxwinsys.cpp.

◆ STR_BUFFER

#define STR_BUFFER   256

Definition at line 49 of file rxwinsys.cpp.

◆ TOO_SMALLBUFFER_MSG

#define TOO_SMALLBUFFER_MSG   "An event log record is too large (%u) for the read buffer (%u.)"

Definition at line 1817 of file rxwinsys.cpp.

◆ VALID_ROUTINE

#define VALID_ROUTINE   0 /* Successful completion */

Definition at line 91 of file rxwinsys.cpp.

◆ WSEL_DEFAULT_EVENTS_ARRAY_SIZE

#define WSEL_DEFAULT_EVENTS_ARRAY_SIZE   512

Definition at line 1797 of file rxwinsys.cpp.

◆ WSEL_DEFAULT_SOURCE

#define WSEL_DEFAULT_SOURCE   "Application"

Definition at line 1798 of file rxwinsys.cpp.

Enumeration Type Documentation

◆ LogNumberOp

Enumerator
record_count 
oldest_record 
youngest_record 

Definition at line 1821 of file rxwinsys.cpp.

Function Documentation

◆ AddPMDesktopIcon()

BOOL AddPMDesktopIcon ( const char *  lpszName,
const char *  lpszProgram,
const char *  lpszIcon,
int  iIconIndex,
const char *  lpszWorkDir,
const char *  lpszLocation,
const char *  lpszArguments,
int  iScKey,
int  iScModifier,
const char *  lpszRun 
)

Definition at line 1534 of file rxwinsys.cpp.

References GetAllUserDesktopLocation(), and GetCurrentUserDesktopLocation().

Referenced by WSProgManager().

◆ AddPMGroup()

BOOL AddPMGroup ( const char *  lpszGroup,
const char *  lpszPath 
)

Definition at line 1257 of file rxwinsys.cpp.

References ProgmanCmd().

Referenced by WSProgManager().

◆ AddPMItem()

BOOL AddPMItem ( const char *  lpszCmdLine,
const char *  lpszCaption,
const char *  lpszIconPath,
WORD  wIconIndex,
const char *  lpszDir,
BOOL  bLast,
const char *  lpszHotKey,
const char *  lpszModifier,
BOOL  bMin 
)

Definition at line 1308 of file rxwinsys.cpp.

References ProgmanCmd().

Referenced by WSProgManager().

◆ checkReadRecordsArgs()

bool checkReadRecordsArgs ( RexxMethodContext context,
HANDLE  hLog,
CSTRING  direction,
uint32_t  start,
uint32_t count,
DWORD *  flags,
DWORD *  rc 
)

Convenience function to do most of the arg checking for the WindowsEventLog::readRecords() method.

Parameters
contextThe method context we're operating under.
hLogThe opened handle to the event log we are dealing with.
directionThe direction arg (arg 1) passed to the method.
startThe start arg (arg 4) passed to the method.
countPointer to the count arg (arg 5) passed to the method. The true count of records to be read is returned here.
flagsPointer to the flags to use in the ReadEventLog() API. The actual flags to use are based on the args passed to the method and returned here.
rcA returned error code, 0 or a system error code.
Returns
True if things should continue, or false if they should not continue.
Note
If false is returned, it is likely that an exception has been raised. But, it may just be an OS system error. In all cases the value of rc should be returned to the interpreter. If an exception has not been raised, it is the system error code that needs to be returned to the ooRexx programmer.

Definition at line 2475 of file rxwinsys.cpp.

References argumentExists, argumentOmitted, END_RECORD_OUT_OF_RANGE_MSG, Rexx_Error_Incorrect_method_noarg, Rexx_Error_Incorrect_method_user_defined, START_RECORD_OUT_OF_RANGE_MSG, and wrongArgValueException().

Referenced by RexxMethod5().

◆ closeEventLog()

DWORD closeEventLog ( RexxMethodContext context)

If the current handle attribute has an opened handle, then it is closed.

Parameters
contextThe method context we are operating under.
Returns
0 if there is no open handle, or on success. If there is an error closing an open handle, then the system error code is returned.

Definition at line 2351 of file rxwinsys.cpp.

References getCurrentHandle(), and setCurrentHandle().

Referenced by RexxMethod0(), and RexxMethod2().

◆ DDECallback()

HDDEDATA CALLBACK DDECallback ( UINT  wType,
UINT  wFmt,
HCONV  hConv,
HSZ  hsz1,
HSZ  hsz2,
HDDEDATA  hDDEData,
DWORD  dwData1,
DWORD  dwData2 
)

Definition at line 1183 of file rxwinsys.cpp.

Referenced by ProgmanCmd().

◆ DeletePMGroup()

BOOL DeletePMGroup ( const char *  lpszGroup)

Definition at line 1278 of file rxwinsys.cpp.

References ProgmanCmd().

Referenced by WSProgManager().

◆ DeletePMItem()

BOOL DeletePMItem ( const char *  lpszItem)

Definition at line 1352 of file rxwinsys.cpp.

References ProgmanCmd().

Referenced by WSProgManager().

◆ DelPMDesktopIcon()

INT DelPMDesktopIcon ( const char *  lpszName,
const char *  lpszLocation 
)

Definition at line 1682 of file rxwinsys.cpp.

References GetAllUserDesktopLocation(), and GetCurrentUserDesktopLocation().

Referenced by WSProgManager().

◆ dwordPtrToRexx()

size_t dwordPtrToRexx ( DWORD_PTR  val,
PRXSTRING  r 
)

Definition at line 95 of file rxwinsys.cpp.

References RXAUTOBUFLEN, _RXSTRING::strlength, and _RXSTRING::strptr.

Referenced by WSCtrlSend().

◆ findAndFormatDescription()

BOOL findAndFormatDescription ( char *  files,
DWORD  msgID,
char **  ppInserts,
LPVOID *  lpMsgBuf 
)

Search a list of messages files for a specified message ID and, if found, format and return the message.

Parameters
filesList of message files separated by a semi-colon.
msgIDThe message ID to search for.
ppInsertsPossible array of insertion strings to use when formatting the message.
lpMsgBufOn success, a returned buffer containing the formatted message.
Returns
True if the message was found and formatted, false if not found or any other error.
Note
On success, lpMsgBuf will have been allocated by FormatMessage(). This buffer must be freed by the caller with LocalFree().

Definition at line 1894 of file rxwinsys.cpp.

Referenced by getEventDescription().

◆ GetAllUserDesktopLocation()

BOOL GetAllUserDesktopLocation ( LPBYTE  szDesktopDir,
LPDWORD  lpcbData 
)

◆ getCurrentHandle()

HANDLE getCurrentHandle ( RexxMethodContext context)

Gets the handle value at the CURRENTHANDLE attribute. If the handle is not null, it is an open handle to an event log.

Parameters
contextThe method context we are operating under.
Returns
An event handle. It is not unexpected that this handle is NULL.

Definition at line 2206 of file rxwinsys.cpp.

References HANDLE_ATTRIBUTE, and NULLOBJECT.

Referenced by closeEventLog(), and getOpenEventLog().

◆ GetCurrentUserDesktopLocation()

BOOL GetCurrentUserDesktopLocation ( LPBYTE  szDesktopDir,
LPDWORD  lpcbData 
)

Definition at line 1398 of file rxwinsys.cpp.

References IDS_CURRENT_DESKTOP, and IDS_REGISTRY_KEY_CURRENT_SHELLFOLDER.

Referenced by AddPMDesktopIcon(), and DelPMDesktopIcon().

◆ getEventBinaryData()

size_t getEventBinaryData ( PEVENTLOGRECORD  pEvLogRecord,
char **  ppBinData 
)

Allocates a buffer and fills it with the event log record's binary data field converted to a character representation. I.e., 4115 would be converted to a series of chars: 01000103 (0x1013 == 4115) and returned in the buffer.

Parameters
pEvLogRecord[in] Pointer to an event log record.
ppBinData[out] Allocated buffer address is returned here.
Returns
Number of characters used to represent the binary data bytes, with 0 having the special meaning that there was no binary data in the event record. When 0 is returned, the actual size of the buffer is 1.
Note
The buffer is allocated using LocalAlloc and must be freed using LocalFree.

Definition at line 2136 of file rxwinsys.cpp.

Referenced by RexxMethod5().

◆ getEventDescription()

void getEventDescription ( PEVENTLOGRECORD  pEvLogRecord,
const char *  pchSource,
char **  ppMessage 
)

Builds up the descriptive message that goes with an event record.

Parameters
pEvLogRecordEvent record of interest.
pchSourceSource of event with an event log.
ppMessageFormatted description is returned here.

Definition at line 1944 of file rxwinsys.cpp.

References findAndFormatDescription(), and lookupMessageFile().

Referenced by RexxMethod5().

◆ getEventLogNumber()

int32_t getEventLogNumber ( RexxMethodContext context,
LogNumberOp  numberType,
CSTRING  server,
CSTRING  source 
)

Gets either the total count of records in the event log, or the record number of the oldest record, or the record number of the youngest record in the event log.

The first record written to the log is record number 1, so 1 is often the oldest record. However, if the user elects to have the log records over-written when the log is full, the oldest record will no longer be 1 as soon as the log starts to overwrite exsiting records.

Parameters
contextThe method context we are operating under.
numberTypeThe number operation, i.e. what to do.
serverThe server arg, see getOpenEventLog() for details.
sourceThe source arg, see getOpenEventLog() for details.
Returns
The number requested on success, or the negated system error code on failure.

Definition at line 2382 of file rxwinsys.cpp.

References getOpenEventLog(), oldest_record, record_count, and youngest_record.

Referenced by RexxMethod2().

◆ getEventUserName()

char* getEventUserName ( PEVENTLOGRECORD  pEvLogRecord)

Translates the security ID value in the event log record to a user name, or "N/A" if that is not possible.

Parameters
pEvLogRecordPointer to event log record.
Returns
Allocated string naming the user.
Note
The string is allocated using LocalAlloc and must be freed using LocalFree.

Definition at line 2078 of file rxwinsys.cpp.

Referenced by RexxMethod5().

◆ getMinimumReadBufferSize()

DWORD getMinimumReadBufferSize ( RexxMethodContext c)

Gets the minimum read buffer size for reading event records from the object attribute. This minimum can be changed by the user. If some error happens, then the original default value is returned.

Parameters
cThe method context we are operating under.
Returns
The current minimum buffer size.

Definition at line 2227 of file rxwinsys.cpp.

References MIN_READ_BUFFER, MIN_READ_BUFFER_ATTRIBUTE, and NULLOBJECT.

Referenced by RexxMethod0(), and RexxMethod5().

◆ getOpenEventLog()

bool getOpenEventLog ( RexxMethodContext context,
const char *  server,
const char *  source,
HANDLE *  pHandle,
DWORD *  pRC 
)

getOpenEventLog()

Gets the opened handle to the specified event log.

For the WindowsEventLog class, a currently opened event log handle always take precedence over anything specified by the user. If currentHandle is not null, then server and source are always ignored.

If there is not a currently opened handle, then the user specified server and source are used. Both server and source have defaults, so the user does not need to specify either.

Note that in the OpenEventLog() call, null is used to indicate the default server (the local machine.) If the user omitted the server arg, then sever will be null, which gives us the default automatically. Also note that historically the empty string has also been used to indicate the default, so that is maintained here.

Parameters
contextThe method context pointer
serverThe server to open the event log on. If specified this must be in UNC format, but we do not check for that, merely let the function fail.
sourceThe source event log to open, may be omitted.
pHandleThe opened handle is returned here.
pRCOn an OS error, the value of GetLastError() is returned here, otherwise 0 is returned here.
Returns
True indicates that the event log handle was opened by this function and should be closed by the caller. False indicates that the handle comes from the currentHandle attribute and should not be closed by the caller.

Definition at line 2310 of file rxwinsys.cpp.

References getCurrentHandle(), and WSEL_DEFAULT_SOURCE.

Referenced by getEventLogNumber(), RexxMethod2(), RexxMethod3(), and RexxMethod5().

◆ getParentKeyHandle()

HKEY getParentKeyHandle ( RexxMethodContext c,
CSTRING  hkParent 
)

Resolves a, possibly omitted, registry key handle in string form to a HKEY.

Most of the registry functions require an open 'parent' key handle. Most of the WindowsRegistry methods allow the user to omitt the parent key handle, in which case the stored 'current key' value is used.

Parameters
cMethod context we are operating under.
hkParentThe parent key value to resolve.
Returns
A HKEY resolved from hkParent, which could be the null value.

Definition at line 338 of file rxwinsys.cpp.

References isHex(), NULLOBJECT, and string2pointer().

Referenced by RexxMethod2(), and RexxMethod3().

◆ getRecordArray()

RexxArrayObject getRecordArray ( RexxMethodContext context)

Gets the records array (the array at the EVENTS attribute.) The array is emptied before it is returnd.

Parameters
contextThe method context we are operating under.
Returns
The empty records array on success, a null object on error.
Note
If NULLOBJECT is returned an exception has been raised.

Definition at line 2252 of file rxwinsys.cpp.

References BAD_RECORD_ARRAY_MSG, NULLOBJECT, RECORDS_ATTRIBUTE, and Rexx_Error_Execution_user_defined.

Referenced by RexxMethod5().

◆ HandleArgError()

LONG HandleArgError ( PRXSTRING  r,
BOOL  ToMuch 
)

Definition at line 102 of file rxwinsys.cpp.

References _RXSTRING::strlength, and _RXSTRING::strptr.

◆ InstWinSysFuncs()

size_t RexxEntry InstWinSysFuncs ( const char *  funcname,
size_t  argc,
CONSTRXSTRING argv,
const char *  qname,
RXSTRING retstr 
)

Prior to 4.0.0, this function was documented as a work around to use the WindowObject class when no WindowManager object had been instantiated. So for now it needs to stay. Does nothing.

Definition at line 4071 of file rxwinsys.cpp.

References RETC.

◆ isGoodEventType()

bool isGoodEventType ( uint16_t  type)
inline

Definition at line 2575 of file rxwinsys.cpp.

References type.

Referenced by RexxMethod7().

◆ isHex()

bool isHex ( CSTRING  value)
inline

Definition at line 206 of file rxwinsys.cpp.

Referenced by getParentKeyHandle(), and string2pointer().

◆ IsRunningNT()

BOOL IsRunningNT ( )

Definition at line 260 of file rxwinsys.cpp.

References version_info.

Referenced by GetAllUserDesktopLocation().

◆ LeavePM()

BOOL LeavePM ( BOOL  bSaveGroups)

Definition at line 1367 of file rxwinsys.cpp.

References ProgmanCmd().

Referenced by WSProgManager().

◆ Little2BigEndian()

VOID Little2BigEndian ( BYTE *  pbInt,
INT  iSize 
)

Definition at line 4049 of file rxwinsys.cpp.

Referenced by WSRegistryValue().

◆ lookupMessageFile()

void lookupMessageFile ( char *  pValueName,
char *  logName,
char *  source,
char *  fileBuffer 
)

Query the registery for the name of an event record's message file. The file name of the message file is stored as a value of a subkey under an application log. The subkey name is the source name of the event. The value name corresponds to the type of message file, event, parameter, or category. (Although the category message file is not currently used by the WindowsEventLog object.)

Parameters
pValueNameThe name of the value whose data is being sought. The data is the message file name.
logNameThe name of the event log.
sourceThe source of the event in the specified event log.
fileBuffer[out] The message file path name is returned in this buffer, which must be at least MAX_PATH in size.

Definition at line 1838 of file rxwinsys.cpp.

Referenced by getEventDescription().

◆ memupper()

void memupper ( char *  location,
size_t  length 
)

Definition at line 76 of file rxwinsys.cpp.

◆ OOREXX_GET_PACKAGE()

OOREXX_GET_PACKAGE ( rxwinsys  )

◆ outOfMemoryException()

void outOfMemoryException ( RexxMethodContext c)
inline

Definition at line 2170 of file rxwinsys.cpp.

References systemServiceException().

Referenced by RexxMethod3(), and RexxMethod5().

◆ pointer2string() [1/3]

void pointer2string ( char *  result,
void *  pointer 
)

Converts a pointer-sized type to a pointer-string, or 0 if the type is null.

Parameters
result[out] Pointer-string is returned here. Ensure the storage pointed to is big enough for a 64-bit pointer.
pointer[in] The pointer, or pointer-sized type to convert.
Remarks
Pointer-sized type is used to indicate that this will work for opaque types, like HANDLE, HMENU, HINST, UINT_PTR, DWORD_PTR, etc., that are pointer size.

For now, 0 is returned for null rather than 0x00000000 because many, many places in the Windows specific classes test for 0 to detect error.

This function should go away when the Windows classes are converted to use .Pointer for all pointer-sized data types.

Definition at line 293 of file rxwinsys.cpp.

◆ pointer2string() [2/3]

void pointer2string ( PRXSTRING  result,
void *  pointer 
)

Definition at line 244 of file rxwinsys.cpp.

References _RXSTRING::strlength, and _RXSTRING::strptr.

Referenced by pointer2string(), RexxMethod0(), and RexxMethod3().

◆ pointer2string() [3/3]

RexxStringObject pointer2string ( RexxMethodContext c,
void *  pointer 
)

Variation of above. Converts the pointer and returns it as a RexxStringObject.

Parameters
cMethod context we are operating in.
pointerPointer to convert
Returns
A string object representing the pointer as either 0xffff1111 if not null or as 0 if null.

Definition at line 316 of file rxwinsys.cpp.

References pointer2string().

◆ ProgmanCmd()

BOOL ProgmanCmd ( LPSTR  lpszCmd)

Definition at line 1195 of file rxwinsys.cpp.

References DDECallback().

Referenced by AddPMGroup(), AddPMItem(), DeletePMGroup(), DeletePMItem(), LeavePM(), and ShowPMGroup().

◆ RexxMethod0() [1/12]

RexxMethod0 ( int  ,
WSEventLog_init   
)

WindowsEventLog::init()

The init() method for the WindowsEventLog object. Sets the object attributes to their default values.

Definition at line 2590 of file rxwinsys.cpp.

References INITCODE_ATTRIBUTE, MAX_READ_KB_COUNT, MIN_READ_BUFFER, MIN_READ_BUFFER_ATTRIBUTE, MIN_READ_KB_COUNT, MIN_READ_MAX_ATTRIBUTE, MIN_READ_MIN_ATTRIBUTE, RECORDS_ATTRIBUTE, setCurrentHandle(), and WSEL_DEFAULT_EVENTS_ARRAY_SIZE.

◆ RexxMethod0() [2/12]

RexxMethod0 ( POINTERSTRING  ,
getClasses_Root   
)

Definition at line 402 of file rxwinsys.cpp.

◆ RexxMethod0() [3/12]

RexxMethod0 ( POINTERSTRING  ,
getCurrent_Config   
)

Definition at line 412 of file rxwinsys.cpp.

◆ RexxMethod0() [4/12]

RexxMethod0 ( POINTERSTRING  ,
getCurrent_User   
)

Definition at line 392 of file rxwinsys.cpp.

◆ RexxMethod0() [5/12]

RexxMethod0 ( POINTERSTRING  ,
getLocal_Machine   
)

Definition at line 387 of file rxwinsys.cpp.

◆ RexxMethod0() [6/12]

RexxMethod0 ( POINTERSTRING  ,
getPerformance_Data   
)

Definition at line 407 of file rxwinsys.cpp.

◆ RexxMethod0() [7/12]

RexxMethod0 ( POINTERSTRING  ,
getUsers   
)

Definition at line 397 of file rxwinsys.cpp.

◆ RexxMethod0() [8/12]

RexxMethod0 ( RexxObjectPtr  ,
getCurrent_Key   
)

Definition at line 376 of file rxwinsys.cpp.

◆ RexxMethod0() [9/12]

RexxMethod0 ( RexxObjectPtr  ,
WSRegistry_init   
)

Definition at line 370 of file rxwinsys.cpp.

References NULLOBJECT, and pointer2string().

◆ RexxMethod0() [10/12]

RexxMethod0 ( uint32_t  ,
WSEventLog_close   
)

WindowsEventLog::close()

If we have an open open event log handle, closes it.

Returns
Returns 0 on success and if there is no open handle to begin with. If there is an error attempting to close an open handle, the OS system error code is returned.

Definition at line 3290 of file rxwinsys.cpp.

References closeEventLog().

◆ RexxMethod0() [11/12]

RexxMethod0 ( uint32_t  ,
WSEventLog_minimumReadGet   
)

WindowsEventLog::minimumRead

Returns the current setting for the minimum read buffer. The value returned is the size of the buffer in KiloBytes.

Returns
The minimum size allocation size of the event log read buffer buffer, in KiloBytes. E.g., if the minimum is set at a 4096 byte buffer, then the return will be 4.

Definition at line 2977 of file rxwinsys.cpp.

References getMinimumReadBufferSize().

◆ RexxMethod0() [12/12]

RexxMethod0 ( uint32_t  ,
WSEventLog_uninit   
)

WindowsEventLog::uninit()

Uninit method for the class. Simply makes sure, if we have an open handle, it gets closed.

Definition at line 3300 of file rxwinsys.cpp.

References closeEventLog().

◆ RexxMethod1() [1/3]

RexxMethod1 ( int  ,
WSEventLog_minimumReadSet  ,
uint32_t  ,
countKB   
)

WindowsEventLog::minimumRead=

Sets the minimumReadBuffer attribute. This attribute controls the minimum allocation size of the buffer used to read in event log records. This value is specified in multiples of 1 KB and must be wtihin the range of MIN_READ_KB_COUNT and MAX_READ_KB_COUNT.

Parameters
countKBThe number of kilobytes for the minimum buffer allocation.

Definition at line 2949 of file rxwinsys.cpp.

References MAX_READ_KB_COUNT, MIN_READ_BUFFER_ATTRIBUTE, MIN_READ_KB_COUNT, and Rexx_Error_Invalid_argument_range.

◆ RexxMethod1() [2/3]

RexxMethod1 ( RexxObjectPtr  ,
setCurrent_Key  ,
RexxStringObject  ,
regKeyHandle   
)

Definition at line 381 of file rxwinsys.cpp.

References NULLOBJECT.

◆ RexxMethod1() [3/3]

RexxMethod1 ( uint32_t  ,
WSEventLog_getLogNames  ,
RexxObjectPtr  ,
obj   
)

WindowsEventLog::getLogNames()

Obtains a list of all the event log names on the current system.

Parameters
logNames[in/out] An .array object in which the event log names are returned.
Returns
An OS return code, 0 on success, the system error code on failure.
Note
The passed in array is emptied before the log names are added. On error, the array will also be empty.

Definition at line 3234 of file rxwinsys.cpp.

References MAX_REGISTRY_KEY_SIZE, and wrongClassException().

◆ RexxMethod2() [1/6]

RexxMethod2 ( int32_t  ,
WSEventLog_getFirst  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source   
)

WindowsEventLog::getFirst()

Returns the record number of the first recorded, or oldest, event. Event log messages are numbered sequentially, with the oldest record having the lowest record number.

Parameters
serverThe server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
sourceThe event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
Returns
The record number of the first recorded event.

Definition at line 2685 of file rxwinsys.cpp.

References getEventLogNumber(), and oldest_record.

◆ RexxMethod2() [2/6]

RexxMethod2 ( int32_t  ,
WSEventLog_getLast  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source   
)

WindowsEventLog::getLast()

Returns the record number of the last recorded, or youngest, event. Event log messages are numbered sequentially, with the oldest record have the lowest record number.

Parameters
serverThe server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
sourceThe event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
Returns
The record number of the last recorded event.

Definition at line 2707 of file rxwinsys.cpp.

References getEventLogNumber(), and youngest_record.

◆ RexxMethod2() [3/6]

RexxMethod2 ( int32_t  ,
WSEventLog_getNumber  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source   
)

WindowsEventLog::getNumber()

Returns the number of event records in the specified log.

Parameters
serverThe server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
sourceThe event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
Returns
The count of records in the log.

Definition at line 2663 of file rxwinsys.cpp.

References getEventLogNumber(), and record_count.

◆ RexxMethod2() [4/6]

RexxMethod2 ( logical_t  ,
WSEventLog_isFull  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source   
)

WindowsEventLog::isFull()

Queries the event log to see if it is full.

Returns
True if event log is full, othewise false. False is also returned if any system error happens.

Definition at line 2719 of file rxwinsys.cpp.

References getOpenEventLog().

◆ RexxMethod2() [5/6]

RexxMethod2 ( uint32_t  ,
WSEventLog_open  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source   
)

WindowsEventLog::open()

Opens a handle to the specified event log.

Parameters
server[optional] The server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
source[optional] The event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
Note
The event logging service will open the Application log if the specified log (the source arg) can not be found.

Definition at line 2622 of file rxwinsys.cpp.

References closeEventLog(), setCurrentHandle(), and WSEL_DEFAULT_SOURCE.

◆ RexxMethod2() [6/6]

RexxMethod2 ( uint32_t  ,
WSRegistry_delete  ,
OPTIONAL_CSTRING  ,
hkParent  ,
CSTRING  ,
subKeyName   
)

WindowsRegistry::delete() | WindowsRegistry::deleteKey()

Deletes a registry key. Maps to both the delete() and the deleteKey() methods.

delete() deletes a subkey and all its descendents (subkeys.) deleteKey() will only delete the subkey if it is empty, i.e. it contains no subkeys.

Parameters
hkParent[optional] A handle to an open registry key, or the name of one of the prefined, always open, registry keys. The key must have been opened with the DELETE access right. If this argument is omitted then the CURRENT_KEY attribute is used.
subkeyNameThe name of the subkey to be deleted. The name is case insensitive.
Returns
O on success, otherwise the Windows system error code.

Definition at line 436 of file rxwinsys.cpp.

References getParentKeyHandle().

◆ RexxMethod3() [1/2]

RexxMethod3 ( RexxObjectPtr  ,
WSRegistry_open  ,
OPTIONAL_CSTRING  ,
hkParent  ,
OPTIONAL_CSTRING  ,
subKeyName  ,
OPTIONAL_CSTRING  ,
access   
)

WindowsRegistry::open()

Opens a subkey with the specified access rights. When the open is successful, the CURRENT_KEY attribute is set to the opened key.

Parameters
hkParent[optional] A handle to an open registry key, or the name of one of the prefined, always open, registry keys. The key must have been opened with the DELETE access right. If this argument is omitted then the CURRENT_KEY attribute is used.
subkeyName[optional] The name of the subkey to be opened. The name is case insensitive. If this argument is omitted or the empty string, the operating system will open a new handle to the key identified by hkParent.
access[optional] A string of 0 or more keywords specifying the desired access rights. The default if this argument is omitted is all access. Specifying a higher level of access than the user has, will cause the open to fail.

Definition at line 472 of file rxwinsys.cpp.

References argumentOmitted, getParentKeyHandle(), and pointer2string().

◆ RexxMethod3() [2/2]

RexxMethod3 ( uint32_t  ,
WSEventLog_clear  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source  ,
OPTIONAL_CSTRING  ,
backupFile   
)

WindowsEventLog::clear()

Clears, empties, the specified event log. Optionally backs up the log before clearing it.

Parameters
serverThe server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
sourceThe event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
backupFileIf specified, the log will be backed up to this file. There is no default value. If backupFile is omitted, the log is not backed up. If a file name is supplied with no extension, the the default event log extension of ".evt" is added.
Returns
0 on success, the system error code otherwise.
Note
Note for the ooRexx docs: The backup file can not exist on a remote machine. In particular, you can not use a backup file that is on a network mapped drive. The clear operation will fail with rc 3 'The system cannot find the path specified.'

Definition at line 2772 of file rxwinsys.cpp.

References getOpenEventLog(), and outOfMemoryException().

◆ RexxMethod4()

RexxMethod4 ( int  ,
WSEventLog_test  ,
RexxStringObject  ,
data  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source  ,
ARGLIST  ,
args   
)

Definition at line 3307 of file rxwinsys.cpp.

◆ RexxMethod5()

RexxMethod5 ( uint32_t  ,
WSEventLog_readRecords  ,
OPTIONAL_CSTRING  ,
direction  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source  ,
OPTIONAL_uint32_t  ,
start  ,
OPTIONAL_uint32_t  ,
count   
)

WindowsEventLog::readRecords()

Reads records from an event log. If no args are given then all records from the default system (the local machine) and the default source (the Application log) are read.

Each record is read from the event log, formatted into a string representation and placed in an ooRexx array object. The array object is the 'events' attribute of the WindowsEventLog. Before the read is started, the array is emptied. After each read, the array will contain the records for the previous read.

Parameters
directionFORWARDS or BACKWARDS default is forwards. The oldest record is considered record 1.
serverThe server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
sourceThe event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
startFirst record to read. The default is all records. If a start record is specified then count is mandatory.
countCount of records to read. Only used if start is specified, in which case count is not optional.
Returns
0 on success, the system error code on failure.

Definition at line 3010 of file rxwinsys.cpp.

References checkReadRecordsArgs(), GET_TYPE_INDEX, getEventBinaryData(), getEventDescription(), getEventUserName(), getMinimumReadBufferSize(), getOpenEventLog(), getRecordArray(), MAX_READ_BUFFER, MAX_TIME_DATE, NULLOBJECT, outOfMemoryException(), Rexx_Error_Execution_user_defined, TOO_SMALLBUFFER_MSG, and WSEL_DEFAULT_SOURCE.

◆ RexxMethod7()

RexxMethod7 ( uint32_t  ,
WSEventLog_write  ,
OPTIONAL_CSTRING  ,
server  ,
OPTIONAL_CSTRING  ,
source  ,
OPTIONAL_uint16_t  ,
,
OPTIONAL_uint16_t  ,
category  ,
OPTIONAL_uint32_t  ,
id  ,
OPTIONAL_RexxStringObject  ,
rawData  ,
ARGLIST  ,
args   
)

WindowsEventLog::write()

Write an event to an event log. In theory all args are optional, but that would not be much of an event.

Parameters
serverThe server to open the event log on. If specified this should be in UNC format. The default is the local machine. The empty string can also be used to specify the local macnine.
sourceThe event log to open, the default is the Application log. The empty string can also be used to specify the local machine.
typeThe event type (EVENTLOG_SUCCESS EVENTLOG_AUDIT_FAILURE, etc.,) the default is 1.
categoryThe event category, default is 0.
idThe event ID, default is 0.
dataRaw binary data, default is none.
stringsArgs 7 to any number. Any number of strings. These are the insertion strings used to contruct the event descripiton.
Returns
0 on success, system error code on failure.

Definition at line 2849 of file rxwinsys.cpp.

References argumentExists, isGoodEventType(), NULLOBJECT, type, and WSEL_DEFAULT_SOURCE.

◆ setCurrentHandle()

void setCurrentHandle ( RexxMethodContext context,
HANDLE  h 
)
inline

Definition at line 2193 of file rxwinsys.cpp.

References HANDLE_ATTRIBUTE.

Referenced by closeEventLog(), RexxMethod0(), and RexxMethod2().

◆ ShowPMGroup()

BOOL ShowPMGroup ( const char *  lpszGroup,
WORD  wCmd 
)

Definition at line 1292 of file rxwinsys.cpp.

References ProgmanCmd().

Referenced by WSProgManager().

◆ string2pointer()

BOOL string2pointer ( const char *  string,
void **  pointer 
)

Definition at line 224 of file rxwinsys.cpp.

References isHex().

Referenced by getParentKeyHandle().

◆ systemServiceException()

void systemServiceException ( RexxMethodContext context,
char *  msg 
)

Definition at line 2165 of file rxwinsys.cpp.

References Rexx_Error_System_service_user_defined.

Referenced by outOfMemoryException().

◆ wrongArgValueException() [1/2]

void wrongArgValueException ( RexxMethodContext c,
int  pos,
const char *  list,
const char *  actual 
)

Definition at line 2181 of file rxwinsys.cpp.

References wrongArgValueException().

◆ wrongArgValueException() [2/2]

void wrongArgValueException ( RexxMethodContext c,
int  pos,
const char *  list,
RexxObjectPtr  actual 
)

Definition at line 2175 of file rxwinsys.cpp.

References Rexx_Error_Incorrect_method_list.

Referenced by checkReadRecordsArgs(), and wrongArgValueException().

◆ wrongClassException()

unsigned int wrongClassException ( RexxMethodContext c,
int  pos,
const char *  n 
)
inline

Definition at line 2186 of file rxwinsys.cpp.

References Rexx_Error_Incorrect_method_noclass.

Referenced by RexxMethod1().

◆ WSClipboard()

size_t RexxEntry WSClipboard ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

Definition at line 3961 of file rxwinsys.cpp.

References CHECKARG, RETC, RETVAL, _RXSTRING::strlength, and _RXSTRING::strptr.

◆ WSCtrlMenu()

size_t RexxEntry WSCtrlMenu ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

◆ WSCtrlSend()

size_t RexxEntry WSCtrlSend ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

◆ WSCtrlWindow()

size_t RexxEntry WSCtrlWindow ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

◆ WSProgManager()

size_t RexxEntry WSProgManager ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

◆ WSRegistryFile()

size_t RexxEntry WSRegistryFile ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

Definition at line 1029 of file rxwinsys.cpp.

References CHECKARG, GET_HKEY, RET_HANDLE, RETC, RETVAL, and _CONSTRXSTRING::strptr.

◆ WSRegistryKey()

size_t RexxEntry WSRegistryKey ( const char *  funcname,
size_t  argc,
CONSTRXSTRING  argv[],
const char *  qname,
PRXSTRING  retstr 
)

◆ WSRegistryValue()

Variable Documentation

◆ rxwinsys_functions

RexxRoutineEntry rxwinsys_functions[]
Initial value:
=
{
}
#define REXX_CLASSIC_ROUTINE(n, e)
Definition: oorexxapi.h:192
size_t RexxEntry InstWinSysFuncs(const char *funcname, size_t argc, CONSTRXSTRING *argv, const char *qname, RXSTRING *retstr)
Definition: rxwinsys.cpp:4071
size_t RexxEntry WSRegistryFile(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:1029
size_t RexxEntry WSProgManager(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:1712
size_t RexxEntry WSCtrlSend(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:3668
size_t RexxEntry WSRegistryKey(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:511
size_t RexxEntry WSCtrlMenu(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:3850
size_t RexxEntry WSRegistryValue(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:641
size_t RexxEntry WSClipboard(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:3961
size_t RexxEntry WSCtrlWindow(const char *funcname, size_t argc, CONSTRXSTRING argv[], const char *qname, PRXSTRING retstr)
Definition: rxwinsys.cpp:3314

Definition at line 4078 of file rxwinsys.cpp.

◆ rxwinsys_methods

RexxMethodEntry rxwinsys_methods[]
Initial value:
= {
REXX_METHOD(WSRegistry_init, WSRegistry_init),
REXX_METHOD(setCurrent_Key, setCurrent_Key),
REXX_METHOD(getCurrent_Key, getCurrent_Key),
REXX_METHOD(getLocal_Machine, getLocal_Machine),
REXX_METHOD(getCurrent_User, getCurrent_User),
REXX_METHOD(getUsers, getUsers),
REXX_METHOD(getClasses_Root, getClasses_Root),
REXX_METHOD(getPerformance_Data, getPerformance_Data),
REXX_METHOD(getCurrent_Config, getCurrent_Config),
REXX_METHOD(WSRegistry_delete, WSRegistry_delete),
REXX_METHOD(WSRegistry_open, WSRegistry_open),
REXX_METHOD(WSEventLog_test, WSEventLog_test),
REXX_METHOD(WSEventLog_init, WSEventLog_init),
REXX_METHOD(WSEventLog_uninit, WSEventLog_uninit),
REXX_METHOD(WSEventLog_open, WSEventLog_open),
REXX_METHOD(WSEventLog_close, WSEventLog_close),
REXX_METHOD(WSEventLog_write, WSEventLog_write),
REXX_METHOD(WSEventLog_readRecords, WSEventLog_readRecords),
REXX_METHOD(WSEventLog_minimumReadSet, WSEventLog_minimumReadSet),
REXX_METHOD(WSEventLog_minimumReadGet, WSEventLog_minimumReadGet),
REXX_METHOD(WSEventLog_getNumber, WSEventLog_getNumber),
REXX_METHOD(WSEventLog_getFirst, WSEventLog_getFirst),
REXX_METHOD(WSEventLog_getLast, WSEventLog_getLast),
REXX_METHOD(WSEventLog_isFull, WSEventLog_isFull),
REXX_METHOD(WSEventLog_getLogNames, WSEventLog_getLogNames),
REXX_METHOD(WSEventLog_clear, WSEventLog_clear),
}
#define REXX_METHOD(n, e)
Definition: oorexxapi.h:211

Definition at line 4093 of file rxwinsys.cpp.

◆ rxwinsys_package_entry

RexxPackageEntry rxwinsys_package_entry
Initial value:
=
{
"RXWINSYS",
"4.0",
NULL,
NULL,
}
#define REXX_INTERPRETER_4_0_0
Definition: oorexxapi.h:216
#define STANDARD_PACKAGE_HEADER
Definition: oorexxapi.h:230
RexxRoutineEntry rxwinsys_functions[]
Definition: rxwinsys.cpp:4078
RexxMethodEntry rxwinsys_methods[]
Definition: rxwinsys.cpp:4093

Definition at line 4124 of file rxwinsys.cpp.