14#define NTLM_ALLOC_TAG "NTLM"
15#define NTLM_ALLOC_TAG_SIZE strlen(NTLM_ALLOC_TAG)
20 _In_ bool UsePrivateLsaHeap)
26 ERR(
"Allocating 0 bytes!\n");
36 if (UsePrivateLsaHeap)
52 ERR(
"NtlmState unknown!\n");
66 _In_ bool FromPrivateLsaHeap)
78 if (FromPrivateLsaHeap)
91 ERR(
"NtlmState unknown!\n");
98 ERR(
"Trying to free NULL!\n");
108 Dst->Length = InitLength;
109 Dst->MaximumLength = SizeInBytes;
123 String->MaximumLength = 0;
164 _In_ bool TerminateWith0)
171 SrcDataMaxLen = SrcDataLen;
173 SrcDataMaxLen +=
sizeof(
WCHAR);
175 if (*AbsoluteOffsetPtr < (
PBYTE)DataStart)
177 ERR(
"Invalid offset\n");
181 if (*AbsoluteOffsetPtr + SrcDataMaxLen > (
PBYTE)DataStart +
DataSize)
183 ERR(
"Out of bounds!\n");
187 memcpy(*AbsoluteOffsetPtr, SrcDataW, SrcDataLen);
188 *DstDataWPtr = (
WCHAR*)*AbsoluteOffsetPtr;
190 (*DstDataWPtr)[SrcDataLen /
sizeof(
WCHAR)] = 0;
191 *AbsoluteOffsetPtr += SrcDataMaxLen;
203 _In_ bool TerminateWith0)
214 DstData->Length = SrcData->Length;
215 DstData->MaximumLength = SrcData->Length;
217 SrcData->MaximumLength +=
sizeof(
WCHAR);
237 String->MaximumLength = 0;
257 String->MaximumLength = 0;
288 &
Buffer->ClientBaseAddress);
314 ERR(
"Buffer->ClientBaseAddress != Buffer->LocalBuffer (something must be wrong!)\n");
320 if (!
Buffer->ClientBaseAddress ||
323 ERR(
"Invalid Buffer - not allocated!\n");
328 Buffer->ClientBaseAddress,
337 _In_ bool FreeClientBuffer,
340 if (!
Buffer->ClientBaseAddress)
347 ERR(
"Buffer->ClientBaseAddress != Buffer->LocalBuffer (something must be wrong!)\n");
353 if (FreeClientBuffer)
363 if (FreeClientBuffer)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
bool NtlmUStrWriteToStruct(_In_ PVOID DataStart, _In_ ULONG DataSize, _Out_ PUNICODE_STRING DstData, _In_ const PUNICODE_STRING SrcData, _Inout_ PBYTE *AbsoluteOffsetPtr, _In_ bool TerminateWith0)
static bool NtlmStructWriteStrW(_In_ PVOID DataStart, _In_ ULONG DataSize, _Out_ PWCHAR *DstDataWPtr, _In_ const WCHAR *SrcDataW, _In_ ULONG SrcDataLen, _Inout_ PBYTE *AbsoluteOffsetPtr, _In_ bool TerminateWith0)
Helper to fill a WCHAR-String in a struct. The stringdata is appended to the struct....
VOID NtlmUStrFree(_In_ PUNICODE_STRING String)
VOID NtlmFree(_In_ PVOID Buffer, _In_ bool FromPrivateLsaHeap)
bool NtlmFixupAndValidateUStr(_Inout_ PUNICODE_STRING String, _In_ ULONG_PTR FixupOffset)
PVOID NtlmAllocate(_In_ size_t Size, _In_ bool UsePrivateLsaHeap)
NTSTATUS NtlmCopyToClientBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ ULONG BufferLength, _Inout_ PNTLM_CLIENT_BUFFER Buffer)
bool NtlmFixupAStr(_Inout_ PSTRING String, _In_ ULONG_PTR FixupOffset)
bool NtlmUStrAlloc(_Inout_ PUNICODE_STRING Dst, _In_ UINT16 SizeInBytes, _In_ UINT16 InitLength)
#define NTLM_ALLOC_TAG_SIZE
NTSTATUS NtlmAllocateClientBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ ULONG BufferLength, _Inout_ PNTLM_CLIENT_BUFFER Buffer)
VOID NtlmFreeClientBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ bool FreeClientBuffer, _Inout_ PNTLM_CLIENT_BUFFER Buffer)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
PLSA_SECPKG_FUNCTION_TABLE LsaFunctions
#define FIXUP_POINTER(Pointer, Offset)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
NTSYSAPI NTSTATUS NTAPI RtlValidateUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING String)
#define STATUS_INTERNAL_ERROR
PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap
PLSA_FREE_PRIVATE_HEAP FreePrivateHeap
PLSA_FREE_LSA_HEAP FreeLsaHeap
PLSA_ALLOCATE_PRIVATE_HEAP AllocatePrivateHeap
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable