1 /* 2 * PROJECT: Authentication Package DLL 3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4 * PURPOSE: Utils for msv1_0 (header) 5 * COPYRIGHT: Copyright 2011 Samuel Serapión 6 * Copyright 2020 Andreas Maier <staubim@quantentunnel.de> 7 */ 8 9 #pragma once 10 11 bool 12 NtlmUStrAlloc( 13 _Out_ PUNICODE_STRING Dst, 14 _In_ UINT16 SizeInBytes, 15 _In_ UINT16 InitLength); 16 17 VOID 18 NtlmUStrFree( 19 _In_ PUNICODE_STRING String); 20 21 bool 22 NtlmUStrWriteToStruct( 23 _In_ PVOID DataStart, 24 _In_ ULONG DataSize, 25 _Out_ PUNICODE_STRING DstData, 26 _In_ const PUNICODE_STRING SrcData, 27 _In_ OUT PBYTE* AbsoluteOffsetPtr, 28 _In_ bool TerminateWith0); 29 30 /* misc */ 31 bool 32 NtlmFixupAndValidateUStr( 33 _Inout_ PUNICODE_STRING String, 34 _In_ ULONG_PTR FixupOffset); 35 36 bool 37 NtlmFixupAStr( 38 _Inout_ PSTRING String, 39 _In_ ULONG_PTR FixupOffset); 40 41 /* ClientBuffer */ 42 typedef struct _NTLM_CLIENT_BUFFER 43 { 44 PVOID ClientBaseAddress; 45 PVOID LocalBuffer; 46 } NTLM_CLIENT_BUFFER, *PNTLM_CLIENT_BUFFER; 47 48 NTSTATUS 49 NtlmAllocateClientBuffer( 50 _In_ PLSA_CLIENT_REQUEST ClientRequest, 51 _In_ ULONG BufferLength, 52 _Inout_ PNTLM_CLIENT_BUFFER Buffer); 53 54 NTSTATUS 55 NtlmCopyToClientBuffer( 56 _In_ PLSA_CLIENT_REQUEST ClientRequest, 57 _In_ ULONG BufferLength, 58 _In_ OUT PNTLM_CLIENT_BUFFER Buffer); 59 60 VOID 61 NtlmFreeClientBuffer( 62 _In_ PLSA_CLIENT_REQUEST ClientRequest, 63 _In_ bool FreeClientBuffer, 64 _Inout_ PNTLM_CLIENT_BUFFER Buffer); 65