diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/tdi/nbf/nbf.h | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ntos/tdi/nbf/nbf.h')
-rw-r--r-- | private/ntos/tdi/nbf/nbf.h | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/private/ntos/tdi/nbf/nbf.h b/private/ntos/tdi/nbf/nbf.h new file mode 100644 index 000000000..2efb3f50d --- /dev/null +++ b/private/ntos/tdi/nbf/nbf.h @@ -0,0 +1,166 @@ +/*++ + +Copyright (c) 1989 Microsoft Corporation + +Module Name: + + nbf.h + +Abstract: + + Private include file for the NBF (NetBIOS Frames Protocol) transport + provider subcomponent of the NTOS project. + +Author: + + Stephen E. Jones (stevej) 25-Oct-1989 + +Revision History: + + David Beaver (dbeaver) 24-Sep-1990 + Remove PDI and PC586-specific support; add NDIS support + +--*/ + +#ifndef _NBF_ +#define _NBF_ + +#include <ntddk.h> + +typedef struct _RTL_SPLAY_LINKS { + struct _RTL_SPLAY_LINKS *Parent; + struct _RTL_SPLAY_LINKS *LeftChild; + struct _RTL_SPLAY_LINKS *RightChild; +} RTL_SPLAY_LINKS; +typedef RTL_SPLAY_LINKS *PRTL_SPLAY_LINKS; + +#define RtlInitializeSplayLinks(Links) { \ + PRTL_SPLAY_LINKS _SplayLinks; \ + _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \ + _SplayLinks->Parent = _SplayLinks; \ + _SplayLinks->LeftChild = NULL; \ + _SplayLinks->RightChild = NULL; \ + } + +#define RtlLeftChild(Links) ( \ + (PRTL_SPLAY_LINKS)(Links)->LeftChild \ + ) + +#define RtlRightChild(Links) ( \ + (PRTL_SPLAY_LINKS)(Links)->RightChild \ + ) + +#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) { \ + PRTL_SPLAY_LINKS _SplayParent; \ + PRTL_SPLAY_LINKS _SplayChild; \ + _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ + _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ + _SplayParent->LeftChild = _SplayChild; \ + _SplayChild->Parent = _SplayParent; \ + } + +#define RtlInsertAsRightChild(ParentLinks,ChildLinks) { \ + PRTL_SPLAY_LINKS _SplayParent; \ + PRTL_SPLAY_LINKS _SplayChild; \ + _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ + _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ + _SplayParent->RightChild = _SplayChild; \ + _SplayChild->Parent = _SplayParent; \ + } + + +PRTL_SPLAY_LINKS +NTAPI +RtlDelete ( + PRTL_SPLAY_LINKS Links + ); + + +VOID +NTAPI +RtlGetCallersAddress( + OUT PVOID *CallersAddress, + OUT PVOID *CallersCaller + ); + +#include <tdikrnl.h> // Transport Driver Interface. + +#include <ndis.h> // Physical Driver Interface. + +#if DEVL +#define STATIC +#else +#define STATIC static +#endif + +#include "nbfconst.h" // private NETBEUI constants. +#include "nbfmac.h" // mac-specific definitions +#include "nbfhdrs.h" // private NETBEUI protocol headers. +#include "nbftypes.h" // private NETBEUI types. +#include "nbfcnfg.h" // configuration information. +#include "nbfprocs.h" // private NETBEUI function prototypes. +#ifdef MEMPRINT +#include "memprint.h" // drt's memory debug print +#endif + + +#ifndef NBF_LOCKS + +#define ACQUIRE_SPIN_LOCK(lock,irql) KeAcquireSpinLock(lock,irql) +#define RELEASE_SPIN_LOCK(lock,irql) KeReleaseSpinLock(lock,irql) + +#if 0 +#define ACQUIRE_DPC_SPIN_LOCK(lock) \ + { KIRQL OldIrql; ASSERT ((lock != NULL) && (KeGetCurrentIrql() == DISPATCH_LEVEL)); KeAcquireSpinLock(lock,&OldIrql); } +#define RELEASE_DPC_SPIN_LOCK(lock) \ + { ASSERT(lock != NULL); KeReleaseSpinLock(lock,DISPATCH_LEVEL); } +#else +#define ACQUIRE_DPC_SPIN_LOCK(lock) KeAcquireSpinLockAtDpcLevel(lock) +#define RELEASE_DPC_SPIN_LOCK(lock) KeReleaseSpinLockFromDpcLevel(lock) +#endif + +#define ENTER_NBF +#define LEAVE_NBF + +#else + +VOID +NbfAcquireSpinLock( + IN PKSPIN_LOCK Lock, + OUT PKIRQL OldIrql, + IN PSZ LockName, + IN PSZ FileName, + IN ULONG LineNumber + ); + +VOID +NbfReleaseSpinLock( + IN PKSPIN_LOCK Lock, + IN KIRQL OldIrql, + IN PSZ LockName, + IN PSZ FileName, + IN ULONG LineNumber + ); + +#define ACQUIRE_SPIN_LOCK(lock,irql) \ + NbfAcquireSpinLock( lock, irql, #lock, __FILE__, __LINE__ ) +#define RELEASE_SPIN_LOCK(lock,irql) \ + NbfReleaseSpinLock( lock, irql, #lock, __FILE__, __LINE__ ) + +#define ACQUIRE_DPC_SPIN_LOCK(lock) \ + { \ + KIRQL OldIrql; \ + NbfAcquireSpinLock( lock, &OldIrql, #lock, __FILE__, __LINE__ ); \ + } +#define RELEASE_DPC_SPIN_LOCK(lock) \ + NbfReleaseSpinLock( lock, DISPATCH_LEVEL, #lock, __FILE__, __LINE__ ) + +#define ENTER_NBF \ + NbfAcquireSpinLock( (PKSPIN_LOCK)NULL, (PKIRQL)NULL, "(Global)", __FILE__, __LINE__ ) +#define LEAVE_NBF \ + NbfReleaseSpinLock( (PKSPIN_LOCK)NULL, (KIRQL)-1, "(Global)", __FILE__, __LINE__ ) + +#endif + + +#endif // def _NBF_ |