123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- {******************************************************************************}
- { }
- { Lan Manager Statistics API interface Unit for Object Pascal }
- { }
- { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
- { Corporation. All Rights Reserved. }
- { }
- { The original file is: lmstats.h, released November 2001. The original Pascal }
- { code is: LmStats.pas, released Februari 2002. The initial developer of the }
- { Pascal code is Marcel van Brakel (brakelm att chello dott 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 }
- { APILIB home page, located at http://jedi-apilib.sourceforge.net }
- { }
- { 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 }
- { }
- {******************************************************************************}
- // $Id: JwaLmStats.pas,v 1.10 2005/09/07 09:54:54 marquardt Exp $
- {$IFNDEF JWA_INCLUDEMODE}
- unit JwaLmStats;
- {$WEAKPACKAGEUNIT}
- {$I jediapilib.inc}
- interface
- uses
- JwaWindows, JwaLmCons;
- {$ENDIF !JWA_INCLUDEMODE}
- {$IFDEF JWA_INTERFACESECTION}
- {$HPPEMIT ''}
- {$HPPEMIT '#include "lmstats.h"'}
- {$HPPEMIT ''}
- //
- // Function Prototypes - Statistics
- //
- function NetStatisticsGet(server: LMSTR; service: LMSTR; level: DWORD; options: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
- {$EXTERNALSYM NetStatisticsGet}
- //
- // Data Structures - Statistics
- //
- {$IFDEF LM20_WORKSTATION_STATISTICS}
- type
- _STAT_WORKSTATION_0 = record
- stw0_start: DWORD;
- stw0_numNCB_r: DWORD;
- stw0_numNCB_s: DWORD;
- stw0_numNCB_a: DWORD;
- stw0_fiNCB_r: DWORD;
- stw0_fiNCB_s: DWORD;
- stw0_fiNCB_a: DWORD;
- stw0_fcNCB_r: DWORD;
- stw0_fcNCB_s: DWORD;
- stw0_fcNCB_a: DWORD;
- stw0_sesstart: DWORD;
- stw0_sessfailcon: DWORD;
- stw0_sessbroke: DWORD;
- stw0_uses: DWORD;
- stw0_usefail: DWORD;
- stw0_autorec: DWORD;
- stw0_bytessent_r_lo: DWORD;
- stw0_bytessent_r_hi: DWORD;
- stw0_bytesrcvd_r_lo: DWORD;
- stw0_bytesrcvd_r_hi: DWORD;
- stw0_bytessent_s_lo: DWORD;
- stw0_bytessent_s_hi: DWORD;
- stw0_bytesrcvd_s_lo: DWORD;
- stw0_bytesrcvd_s_hi: DWORD;
- stw0_bytessent_a_lo: DWORD;
- stw0_bytessent_a_hi: DWORD;
- stw0_bytesrcvd_a_lo: DWORD;
- stw0_bytesrcvd_a_hi: DWORD;
- stw0_reqbufneed: DWORD;
- stw0_bigbufneed: DWORD;
- end;
- {$EXTERNALSYM _STAT_WORKSTATION_0}
- STAT_WORKSTATION_0 = _STAT_WORKSTATION_0;
- {$EXTERNALSYM STAT_WORKSTATION_0}
- PSTAT_WORKSTATION_0 = ^STAT_WORKSTATION_0;
- {$EXTERNALSYM PSTAT_WORKSTATION_0}
- LPSTAT_WORKSTATION_0 = ^STAT_WORKSTATION_0;
- {$EXTERNALSYM LPSTAT_WORKSTATION_0}
- TStatWorkstation0 = STAT_WORKSTATION_0;
- PStatWorkstation0 = PSTAT_WORKSTATION_0;
- {$ELSE}
- //
- // NB: The following structure is REDIR_STATISTICS in sdk\inc\ntddnfs.h. If you
- // change the structure, change it in both places
- //
- type
- _STAT_WORKSTATION_0 = record
- StatisticsStartTime: LARGE_INTEGER;
- BytesReceived: LARGE_INTEGER;
- SmbsReceived: LARGE_INTEGER;
- PagingReadBytesRequested: LARGE_INTEGER;
- NonPagingReadBytesRequested: LARGE_INTEGER;
- CacheReadBytesRequested: LARGE_INTEGER;
- NetworkReadBytesRequested: LARGE_INTEGER;
- BytesTransmitted: LARGE_INTEGER;
- SmbsTransmitted: LARGE_INTEGER;
- PagingWriteBytesRequested: LARGE_INTEGER;
- NonPagingWriteBytesRequested: LARGE_INTEGER;
- CacheWriteBytesRequested: LARGE_INTEGER;
- NetworkWriteBytesRequested: LARGE_INTEGER;
- InitiallyFailedOperations: DWORD;
- FailedCompletionOperations: DWORD;
- ReadOperations: DWORD;
- RandomReadOperations: DWORD;
- ReadSmbs: DWORD;
- LargeReadSmbs: DWORD;
- SmallReadSmbs: DWORD;
- WriteOperations: DWORD;
- RandomWriteOperations: DWORD;
- WriteSmbs: DWORD;
- LargeWriteSmbs: DWORD;
- SmallWriteSmbs: DWORD;
- RawReadsDenied: DWORD;
- RawWritesDenied: DWORD;
- NetworkErrors: DWORD;
- // Connection/Session counts
- Sessions: DWORD;
- FailedSessions: DWORD;
- Reconnects: DWORD;
- CoreConnects: DWORD;
- Lanman20Connects: DWORD;
- Lanman21Connects: DWORD;
- LanmanNtConnects: DWORD;
- ServerDisconnects: DWORD;
- HungSessions: DWORD;
- UseCount: DWORD;
- FailedUseCount: DWORD;
- //
- // Queue Lengths (updates protected by RdrMpxTableSpinLock NOT
- // RdrStatisticsSpinlock)
- //
- CurrentCommands: DWORD;
- end;
- {$EXTERNALSYM _STAT_WORKSTATION_0}
- STAT_WORKSTATION_0 = _STAT_WORKSTATION_0;
- {$EXTERNALSYM STAT_WORKSTATION_0}
- PSTAT_WORKSTATION_0 = ^STAT_WORKSTATION_0;
- {$EXTERNALSYM PSTAT_WORKSTATION_0}
- LPSTAT_WORKSTATION_0 = ^STAT_WORKSTATION_0;
- {$EXTERNALSYM LPSTAT_WORKSTATION_0}
- TStatWorkstation0 = STAT_WORKSTATION_0;
- PStatWorkstation0 = PSTAT_WORKSTATION_0;
- {$ENDIF LM20_WORKSTATION_STATISTICS}
- type
- _STAT_SERVER_0 = record
- sts0_start: DWORD;
- sts0_fopens: DWORD;
- sts0_devopens: DWORD;
- sts0_jobsqueued: DWORD;
- sts0_sopens: DWORD;
- sts0_stimedout: DWORD;
- sts0_serrorout: DWORD;
- sts0_pwerrors: DWORD;
- sts0_permerrors: DWORD;
- sts0_syserrors: DWORD;
- sts0_bytessent_low: DWORD;
- sts0_bytessent_high: DWORD;
- sts0_bytesrcvd_low: DWORD;
- sts0_bytesrcvd_high: DWORD;
- sts0_avresponse: DWORD;
- sts0_reqbufneed: DWORD;
- sts0_bigbufneed: DWORD;
- end;
- {$EXTERNALSYM _STAT_SERVER_0}
- STAT_SERVER_0 = _STAT_SERVER_0;
- {$EXTERNALSYM STAT_SERVER_0}
- PSTAT_SERVER_0 = ^STAT_SERVER_0;
- {$EXTERNALSYM PSTAT_SERVER_0}
- LPSTAT_SERVER_0 = ^STAT_SERVER_0;
- {$EXTERNALSYM LPSTAT_SERVER_0}
- TStatServer0 = STAT_SERVER_0;
- PStatServer0 = PSTAT_SERVER_0;
- //
- // Special Values and Constants
- //
- const
- STATSOPT_CLR = 1;
- {$EXTERNALSYM STATSOPT_CLR}
- STATS_NO_VALUE = ULONG(-1);
- {$EXTERNALSYM STATS_NO_VALUE}
- STATS_OVERFLOW = ULONG(-2);
- {$EXTERNALSYM STATS_OVERFLOW}
- {$ENDIF JWA_INTERFACESECTION}
- {$IFNDEF JWA_INCLUDEMODE}
- implementation
- uses
- JwaWinDLLNames;
- {$ENDIF !JWA_INCLUDEMODE}
- {$IFDEF JWA_IMPLEMENTATIONSECTION}
- {$IFDEF DYNAMIC_LINK}
- var
- _NetStatisticsGet: Pointer;
- function NetStatisticsGet;
- begin
- GetProcedureAddress(_NetStatisticsGet, netapi32, 'NetStatisticsGet');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_NetStatisticsGet]
- end;
- end;
- {$ELSE}
- function NetStatisticsGet; external netapi32 name 'NetStatisticsGet';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF JWA_IMPLEMENTATIONSECTION}
- {$IFNDEF JWA_INCLUDEMODE}
- end.
- {$ENDIF !JWA_INCLUDEMODE}
|