The NetAuditWrite API writes an audit trail entry to the local audit log file.
Restrictions
A call to this API can be issued only from an OS/2 application to a local LAN Server workstation.
#include <netcons.h> #include <audit.h> NetAuditWrite(audtype, buf, usBuflen, reserved1, reserved2); /* 16 bit */ Net32AuditWrite(audtype, buf, ulBuflen, reserved1, reserved2); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
audtype
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌─────────────────────────────┬───────┬────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_PATH_NOT_FOUND │ 3 │ The path was not found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_SHARING_VIOLATION │ 32 │ A sharing violation occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NOT_SUPPORTED │ 50 │ This request is not supported by the
│
│ │ │ network. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NETWORK_ACCESS_DENIED │ 65 │ Network access is denied. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NET_WRITE_FAULT │ 88 │ A network data fault has occurred.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNotStarted │ 2102 │ The redirector NETWKSTA.200 has not
│
│ │ │ been started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_WkstaNotStarted │ 2138 │ The Requester service has not been
│
│ │ │ started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_LogOverflow │ 2377 │ This log file exceeds the maximum │
│ │ │ defined size. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
NetAuditWrite issues an admin alert by calling the NetAlertRaise API when the audit log file reaches 80% capacity and again when the file reaches 100% capacity. At 100% audit log capacity, the NetAuditWrite API fails, returning the error code NERR_LogOverflow.
To return successfully, the NetAuditWrite API requires that the auditing entry in the IBMLAN.INI file be set to YES, as follows:
AUDITING = YESRelated Information
For information about: