windows-nt/Source/XPSP1/NT/net/sfm/uam/uam5src/uamsrc/ntlmsspi.h

1 line
7.7 KiB
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
/*++ Copyright (c) 1993 Microsoft Corporation Module Name: ntlmsspi.h Abstract: Header file describing the interface to code common to the NT Lanman Security Support Provider (NtLmSsp) Service and the DLL. Author: Cliff Van Dyke (CliffV) 17-Sep-1993 Revision History: --*/ #ifndef _NTLMSSPI_INCLUDED_ #define _NTLMSSPI_INCLUDED_ #include <cwchar> //#ifdef TARGET_OS_MAC #define SEC_FAR #define FAR #define _fmemcpy memcpy #define _fmemcmp memcmp #define _fmemset memset #define _fstrcmp strcmp #define _fstrcpy strcpy #define _fstrlen strlen #define _fstrncmp strncmp //#endif #ifdef DOS #ifndef FAR #define FAR far #endif #ifndef SEC_FAR #define SEC_FAR FAR #endif #endif //#include <sysinc.h> #define MSV1_0_CHALLENGE_LENGTH 8 #ifndef IN #define IN #define OUT #define OPTIONAL #endif #define ARGUMENT_PRESENT(ArgumentPointer) (\ (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) ) #define UNREFERENCED_PARAMETER(P) #ifdef MAC #define swaplong(Value) \ Value = ( (((Value) & 0xFF000000) >> 24) \ | (((Value) & 0x00FF0000) >> 8) \ | (((Value) & 0x0000FF00) << 8) \ | (((Value) & 0x000000FF) << 24)) #else #define swaplong(Value) #endif #ifdef TARGET_OS_MAC #define swapshort(Value) \ Value = ( (((Value) & 0x00FF) << 8) \ | (((Value) & 0xFF00) >> 8)) #else #define swapshort(Value) #endif #ifndef TRUE typedef bool BOOL; #define FALSE 0 #define TRUE 1 #endif #ifndef SEC_FAR #define SEC_FAR #endif typedef unsigned long ULONG, DWORD, *PULONG; typedef unsigned long SEC_FAR *LPULONG; typedef unsigned short USHORT, WORD; typedef char CHAR, *PCHAR; typedef unsigned char UCHAR, *PUCHAR; typedef unsigned char SEC_FAR *LPUCHAR; typedef void SEC_FAR *PVOID, *LPVOID; typedef unsigned char BOOLEAN; typedef long LUID, *PLUID; typedef wchar_t WCHAR; typedef PCHAR LPSTR; // // Calculate the address of the base of the structure given its type, and an // address of a field within the structure. // #define CONTAINING_RECORD(address, type, field) ((type *)( \ (PCHAR)(address) - \ (PCHAR)(&((type *)0)->field))) // // Counted String // typedef struct _STRING { USHORT Length; USHORT MaximumLength; PCHAR Buffer; } STRING, *PSTRING; typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; } LIST_ENTRY, *PLIST_ENTRY; // // VOID // InitializeListHead( // PLIST_ENTRY ListHead // ); // #define InitializeListHead(ListHead) (\ (ListHead)->Flink = (ListHead)->Blink = (ListHead)) // // VOID // RemoveEntryList( // PLIST_ENTRY Entry // ); // #define RemoveEntryList(Entry) {\ PLIST_ENTRY _EX_Blink;\ PLIST_ENTRY _EX_Flink;\ _EX_Flink = (Entry)->Flink;\ _EX_Blink = (Entry)->Blink;\ _EX_Blink->Flink = _EX_Flink;\ _EX_Flink->Blink = _EX_Blink;\ } // // VOID // InsertHeadList( // PLIST_ENTRY ListHead, // PLIST_ENTRY Entry // ); // #define InsertHeadList(ListHead,Entry) {\ PLIST_ENTRY _EX_Flink;\ PLIST_ENTRY _EX_ListHead;\ _EX_ListHead = (ListHead);\ _EX_Flink = _EX_ListHead->Flink;\ (Entry)->Flink = _EX_Flink;\ (Entry)->Blink = _EX_ListHead;\ _EX_Flink->Blink = (Entry);\ _EX_ListHead->Flink = (Entry);\ } // // BOOLEAN // IsListEmpty( // PLIST_ENTRY ListHead // ); // #define IsListEmpty(ListHead) \ ((ListHead)->Flink == (ListHead)) // // Maximum lifetime of a context // //#define NTLMSSP_MAX_LIFETIME (2*60*1000)L // 2 minutes #define NTLMSSP_MAX_LIFETIME 120000L // 2 minutes //////////////////////////////////////////////////////////////////////// // // Opaque Messages passed between client and server // //////////////////////////////////////////////////////////////////////// #define NTLMSSP_SIGNATURE "NTLMSSP" // // MessageType for the following messages. // typedef enum { NtLmNegotiate = 1, NtLmChallenge, NtLmAuthenticate } NTLM_MESSAGE_TYPE; // // Valid values of Negotiate