📄 jwalmerrlog.pas
字号:
{******************************************************************************}
{ }
{ Lan Manager Error Log API interface Unit for Object Pascal }
{ }
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
{ Corporation. All Rights Reserved. }
{ }
{ The original file is: lmerrlog.h, released November 2001. The original Pascal}
{ code is: LmErrLog.pas, released Februari 2002. The initial developer of the }
{ Pascal code is Marcel van Brakel (brakelm@chello.nl). }
{ }
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
{ Marcel van Brakel. All Rights Reserved. }
{ }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ You may retrieve the latest version of this file at the Project JEDI home }
{ page, located at http://delphi-jedi.org or my personal homepage located at }
{ http://members.chello.nl/m.vanbrakel2 }
{ }
{ The contents of this file are used with permission, subject to the Mozilla }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License. }
{ }
{ Alternatively, the contents of this file may be used under the terms of the }
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
{ provisions of the LGPL License are applicable instead of those above. }
{ If you wish to allow use of your version of this file only under the terms }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting the provisions above and }
{ replace them with the notice and other provisions required by the LGPL }
{ License. If you do not delete the provisions above, a recipient may use }
{ your version of this file under either the MPL or the LGPL License. }
{ }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ }
{******************************************************************************}
unit JwaLmErrLog;
{$WEAKPACKAGEUNIT}
{$HPPEMIT ''}
{$HPPEMIT '#include "lmerrlog.h"'}
{$HPPEMIT ''}
{$I WINDEFINES.INC}
interface
uses
JwaLmCons, JwaWinType;
//
// Data Structures - Config
//
type
_ERROR_LOG = record
el_len: DWORD;
el_reserved: DWORD;
el_time: DWORD;
el_error: DWORD;
el_name: LPWSTR; // pointer to service name
el_text: LPWSTR; // pointer to string array
el_data: LPBYTE; // pointer to BYTE array
el_data_size: DWORD; // byte count of el_data area
el_nstrings: DWORD; // number of strings in el_text.
end;
{$EXTERNALSYM _ERROR_LOG}
ERROR_LOG = _ERROR_LOG;
{$EXTERNALSYM ERROR_LOG}
PERROR_LOG = ^ERROR_LOG;
{$EXTERNALSYM PERROR_LOG}
LPERROR_LOG = ^ERROR_LOG;
{$EXTERNALSYM LPERROR_LOG}
TErrorLog = ERROR_LOG;
PErrorLog = PERROR_LOG;
{$DEFINE REVISED_ERROR_LOG_STRUCT}
_HLOG = record
time: DWORD;
last_flags: DWORD;
offset: DWORD;
rec_offset: DWORD;
end;
{$EXTERNALSYM _HLOG}
HLOG = _HLOG;
{$EXTERNALSYM HLOG}
PHLOG = ^HLOG;
{$EXTERNALSYM PHLOG}
LPHLOG = ^HLOG;
{$EXTERNALSYM LPHLOG}
const
LOGFLAGS_FORWARD = 0;
{$EXTERNALSYM LOGFLAGS_FORWARD}
LOGFLAGS_BACKWARD = $1;
{$EXTERNALSYM LOGFLAGS_BACKWARD}
LOGFLAGS_SEEK = $2;
{$EXTERNALSYM LOGFLAGS_SEEK}
//
// Function Prototypes - ErrorLog
//
function NetErrorLogClear(server, backupfile: LPCWSTR; reserved: LPBYTE): NET_API_STATUS; stdcall;
{$EXTERNALSYM NetErrorLogClear}
function NetErrorLogRead(server: LPCWSTR; reserved1: LPWSTR; errloghandle: LPHLOG; offset: DWORD; reserved2: LPDWORD;
reserved3, offsetflag: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; bytesread, totalbytes: LPDWORD): NET_API_STATUS; stdcall;
{$EXTERNALSYM NetErrorLogRead}
function NetErrorLogWrite(reserved1: LPBYTE; code: DWORD; component: LPCWSTR; buffer: LPBYTE; numbytes: DWORD;
msgbuf: LPBYTE; strcount: DWORD; reserved2: LPBYTE): NET_API_STATUS; stdcall;
{$EXTERNALSYM NetErrorLogWrite}
//
// Special Values and Constants
//
//
// Generic (could be used by more than one service)
// error log messages from 0 to 25
//
// Do not change the comments following the manifest constants without
// understanding how mapmsg works.
//
const
ERRLOG_BASE = 3100; { NELOG errors start here }
{$EXTERNALSYM ERRLOG_BASE}
NELOG_Internal_Error = (ERRLOG_BASE + 0);
{$EXTERNALSYM NELOG_Internal_Error}
{
* The operation failed because a network software error occurred.
}
NELOG_Resource_Shortage = (ERRLOG_BASE + 1);
{$EXTERNALSYM NELOG_Resource_Shortage}
{
* The system ran out of a resource controlled by the %1 option.
}
NELOG_Unable_To_Lock_Segment = (ERRLOG_BASE + 2);
{$EXTERNALSYM NELOG_Unable_To_Lock_Segment}
{
* The service failed to obtain a long-term lock on the
* segment for network control blocks (NCBs). The error code is the data.
}
NELOG_Unable_To_Unlock_Segment = (ERRLOG_BASE + 3);
{$EXTERNALSYM NELOG_Unable_To_Unlock_Segment}
{
* The service failed to release the long-term lock on the
* segment for network control blocks (NCBs). The error code is the data.
}
NELOG_Uninstall_Service = (ERRLOG_BASE + 4);
{$EXTERNALSYM NELOG_Uninstall_Service}
{
* There was an error stopping service %1.
* The error code from NetServiceControl is the data.
}
NELOG_Init_Exec_Fail = (ERRLOG_BASE + 5);
{$EXTERNALSYM NELOG_Init_Exec_Fail}
{
* Initialization failed because of a system execution failure on
* path %1. The system error code is the data.
}
NELOG_Ncb_Error = (ERRLOG_BASE + 6);
{$EXTERNALSYM NELOG_Ncb_Error}
{
* An unexpected network control block (NCB) was received. The NCB is the data.
}
NELOG_Net_Not_Started = (ERRLOG_BASE + 7);
{$EXTERNALSYM NELOG_Net_Not_Started}
{
* The network is not started.
}
NELOG_Ioctl_Error = (ERRLOG_BASE + 8);
{$EXTERNALSYM NELOG_Ioctl_Error}
{
* A DosDevIoctl or DosFsCtl to NETWKSTA.SYS failed.
* The data shown is in this format:
* DWORD approx CS:IP of call to ioctl or fsctl
* WORD error code
* WORD ioctl or fsctl number
}
NELOG_System_Semaphore = (ERRLOG_BASE + 9);
{$EXTERNALSYM NELOG_System_Semaphore}
{
* Unable to create or open system semaphore %1.
* The error code is the data.
}
NELOG_Init_OpenCreate_Err = (ERRLOG_BASE + 10);
{$EXTERNALSYM NELOG_Init_OpenCreate_Err}
{
* Initialization failed because of an open/create error on the
* file %1. The system error code is the data.
}
NELOG_NetBios = (ERRLOG_BASE + 11);
{$EXTERNALSYM NELOG_NetBios}
{
* An unexpected NetBIOS error occurred.
* The error code is the data.
}
NELOG_SMB_Illegal = (ERRLOG_BASE + 12);
{$EXTERNALSYM NELOG_SMB_Illegal}
{
* An illegal server message block (SMB) was received.
* The SMB is the data.
}
NELOG_Service_Fail = (ERRLOG_BASE + 13);
{$EXTERNALSYM NELOG_Service_Fail}
{
* Initialization failed because the requested service %1
* could not be started.
}
NELOG_Entries_Lost = (ERRLOG_BASE + 14);
{$EXTERNALSYM NELOG_Entries_Lost}
{
* Some entries in the error log were lost because of a buffer
* overflow.
}
//
// Server specific error log messages from 20 to 40
//
NELOG_Init_Seg_Overflow = (ERRLOG_BASE + 20);
{$EXTERNALSYM NELOG_Init_Seg_Overflow}
{
* Initialization parameters controlling resource usage other
* than net buffers are sized so that too much memory is needed.
}
NELOG_Srv_No_Mem_Grow = (ERRLOG_BASE + 21);
{$EXTERNALSYM NELOG_Srv_No_Mem_Grow}
{
* The server cannot increase the size of a memory segment.
}
NELOG_Access_File_Bad = (ERRLOG_BASE + 22);
{$EXTERNALSYM NELOG_Access_File_Bad}
{
* Initialization failed because account file %1 is either incorrect
* or not present.
}
NELOG_Srvnet_Not_Started = (ERRLOG_BASE + 23);
{$EXTERNALSYM NELOG_Srvnet_Not_Started}
{
* Initialization failed because network %1 was not started.
}
NELOG_Init_Chardev_Err = (ERRLOG_BASE + 24);
{$EXTERNALSYM NELOG_Init_Chardev_Err}
{
* The server failed to start. Either all three chdev
* parameters must be zero or all three must be nonzero.
}
NELOG_Remote_API = (ERRLOG_BASE + 25);
{$EXTERNALSYM NELOG_Remote_API}
{ A remote API request was halted due to the following
* invalid description string: %1.
}
NELOG_Ncb_TooManyErr = (ERRLOG_BASE + 26);
{$EXTERNALSYM NELOG_Ncb_TooManyErr}
{ The network %1 ran out of network control blocks (NCBs). You may need to increase NCBs
* for this network. The following information includes the
* number of NCBs submitted by the server when this error occurred:
}
NELOG_Mailslot_err = (ERRLOG_BASE + 27);
{$EXTERNALSYM NELOG_Mailslot_err}
{ The server cannot create the %1 mailslot needed to send
* the ReleaseMemory alert message. The error received is:
}
NELOG_ReleaseMem_Alert = (ERRLOG_BASE + 28);
{$EXTERNALSYM NELOG_ReleaseMem_Alert}
{ The server failed to register for the ReleaseMemory alert,
* with recipient %1. The error code from
* NetAlertStart is the data.
}
NELOG_AT_cannot_write = (ERRLOG_BASE + 29);
{$EXTERNALSYM NELOG_AT_cannot_write}
{ The server cannot update the AT schedule file. The file
* is corrupted.
}
NELOG_Cant_Make_Msg_File = (ERRLOG_BASE + 30);
{$EXTERNALSYM NELOG_Cant_Make_Msg_File}
{ The server encountered an error when calling
* NetIMakeLMFileName. The error code is the data.
}
NELOG_Exec_Netservr_NoMem = (ERRLOG_BASE + 31);
{$EXTERNALSYM NELOG_Exec_Netservr_NoMem}
{ Initialization failed because of a system execution failure on
* path %1. There is not enough memory to start the process.
* The system error code is the data.
}
NELOG_Server_Lock_Failure = (ERRLOG_BASE + 32);
{$EXTERNALSYM NELOG_Server_Lock_Failure}
{ Longterm lock of the server buffers failed.
* Check swap disk's free space and restart the system to start the server.
}
//
// Message service and POPUP specific error log messages from 40 to 55
//
NELOG_Msg_Shutdown = (ERRLOG_BASE + 40);
{$EXTERNALSYM NELOG_Msg_Shutdown}
{
* The service has stopped due to repeated consecutive
* occurrences of a network control block (NCB) error. The last bad NCB follows
* in raw data.
}
NELOG_Msg_Sem_Shutdown = (ERRLOG_BASE + 41);
{$EXTERNALSYM NELOG_Msg_Sem_Shutdown}
{
* The Message server has stopped due to a lock on the
* Message server shared data segment.
}
NELOG_Msg_Log_Err = (ERRLOG_BASE + 50);
{$EXTERNALSYM NELOG_Msg_Log_Err}
{
* A file system error occurred while opening or writing to the
* system message log file %1. Message logging has been
* switched off due to the error. The error code is the data.
}
NELOG_VIO_POPUP_ERR = (ERRLOG_BASE + 51);
{$EXTERNALSYM NELOG_VIO_POPUP_ERR}
{
* Unable to display message POPUP due to system VIO call error.
* The error code is the data.
}
NELOG_Msg_Unexpected_SMB_Type = (ERRLOG_BASE + 52);
{$EXTERNALSYM NELOG_Msg_Unexpected_SMB_Type}
{
* An illegal server message block (SMB) was received. The SMB is the data.
}
//
// Workstation specific error log messages from 60 to 75
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -