Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (ntlm) |
|
PVOID | NtlmAllocate (_In_ size_t Size, _In_ bool UsePrivateLsaHeap) |
|
VOID | NtlmFree (_In_ PVOID Buffer, _In_ bool FromPrivateLsaHeap) |
|
bool | NtlmUStrAlloc (_Inout_ PUNICODE_STRING Dst, _In_ UINT16 SizeInBytes, _In_ UINT16 InitLength) |
|
VOID | NtlmUStrFree (_In_ PUNICODE_STRING String) |
|
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. The function does not allocate memory.
|
|
bool | NtlmUStrWriteToStruct (_In_ PVOID DataStart, _In_ ULONG DataSize, _Out_ PUNICODE_STRING DstData, _In_ const PUNICODE_STRING SrcData, _Inout_ PBYTE *AbsoluteOffsetPtr, _In_ bool TerminateWith0) |
|
bool | NtlmFixupAndValidateUStr (_Inout_ PUNICODE_STRING String, _In_ ULONG_PTR FixupOffset) |
|
bool | NtlmFixupAStr (_Inout_ PSTRING String, _In_ ULONG_PTR FixupOffset) |
|
NTSTATUS | NtlmAllocateClientBuffer (_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ ULONG BufferLength, _Inout_ PNTLM_CLIENT_BUFFER Buffer) |
|
NTSTATUS | NtlmCopyToClientBuffer (_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) |
|
◆ NTLM_ALLOC_TAG
◆ NTLM_ALLOC_TAG_SIZE
◆ NtlmAllocate()
Definition at line 18 of file util.c.
21{
23
25 {
26 ERR(
"Allocating 0 bytes!\n");
28 }
29
31
33 {
35 {
36 if (UsePrivateLsaHeap)
38 else
40
43 break;
44 }
46 {
48 break;
49 }
50 default:
51 {
52 ERR(
"NtlmState unknown!\n");
53 break;
54 }
55 }
56
59
61}
#define NTLM_ALLOC_TAG_SIZE
#define memcpy(s1, s2, n)
PLSA_SECPKG_FUNCTION_TABLE LsaFunctions
PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap
PLSA_ALLOCATE_PRIVATE_HEAP AllocatePrivateHeap
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Referenced by NtlmAllocateClientBuffer(), and NtlmUStrAlloc().
◆ NtlmAllocateClientBuffer()
Definition at line 264 of file util.c.
268{
270
273
277
279 {
281
282
283 }
284 else
285 {
288 &
Buffer->ClientBaseAddress);
290 {
293 }
294
295
296 }
298}
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
VOID NtlmFree(_In_ PVOID Buffer, _In_ bool FromPrivateLsaHeap)
PVOID NtlmAllocate(_In_ size_t Size, _In_ bool UsePrivateLsaHeap)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
Referenced by BuildLm20LogonProfileBuffer().
◆ NtlmCopyToClientBuffer()
Definition at line 301 of file util.c.
305{
307
309 {
310
311
313 {
314 ERR(
"Buffer->ClientBaseAddress != Buffer->LocalBuffer (something must be wrong!)\n");
316 }
317 }
318 else
319 {
320 if (!
Buffer->ClientBaseAddress ||
322 {
323 ERR(
"Invalid Buffer - not allocated!\n");
325 }
328 Buffer->ClientBaseAddress,
330 }
332}
#define STATUS_INTERNAL_ERROR
Referenced by BuildLm20LogonProfileBuffer().
◆ NtlmFixupAndValidateUStr()
Definition at line 223 of file util.c.
226{
228
230 {
233 }
234 else
235 {
237 String->MaximumLength = 0;
238 }
239
242}
#define FIXUP_POINTER(Pointer, Offset)
NTSYSAPI NTSTATUS NTAPI RtlValidateUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING String)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Referenced by LsaApLogonUserEx2_Network().
◆ NtlmFixupAStr()
◆ NtlmFree()
Definition at line 64 of file util.c.
67{
69 {
73
75 {
77 {
78 if (FromPrivateLsaHeap)
80 else
82 break;
83 }
85 {
87 break;
88 }
89 default:
90 {
91 ERR(
"NtlmState unknown!\n");
92 break;
93 }
94 }
95 }
96 else
97 {
98 ERR(
"Trying to free NULL!\n");
99 }
100}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define HeapFree(x, y, z)
PLSA_FREE_PRIVATE_HEAP FreePrivateHeap
PLSA_FREE_LSA_HEAP FreeLsaHeap
Referenced by NtlmAllocateClientBuffer(), NtlmFreeClientBuffer(), and NtlmUStrFree().
◆ NtlmFreeClientBuffer()
Definition at line 335 of file util.c.
339{
340 if (!
Buffer->ClientBaseAddress)
341 return;
342
344 {
346 {
347 ERR(
"Buffer->ClientBaseAddress != Buffer->LocalBuffer (something must be wrong!)\n");
348 return;
349 }
350
351
353 if (FreeClientBuffer)
354 {
357 }
358 }
359 else
360 {
363 if (FreeClientBuffer)
366 }
367}
Referenced by BuildLm20LogonProfileBuffer().
◆ NtlmStructWriteStrW()
Helper to fill a WCHAR-String in a struct. The stringdata is appended to the struct. The function does not allocate memory.
- Parameters
-
[in] | DataStart | Start address of the struct |
[in] | DataSize | Size of allocated memory (including payload) |
[out] | DstDataWPtr | Pointer to the WCHAR* datafield. The address of the data will be written to it. |
[in] | SrcDataW | Data to write/append at pOffset (payload). pOffset will be increased after writing data. |
[in] | SrcDataLen | SrcDataLen is the length in bytes without terminator. if 0 it will be autodetected by assuming a 0-terminating string. |
[in,out] | AbsoluteOffsetPtr | Current absolute offset. Will be increased by data length. |
[in] | TerminateWith0 | Whether to terminate the string with a NULL-char. |
- Returns
- FALSE if something went wrong
Definition at line 157 of file util.c.
165{
167
168 if (SrcDataLen == 0)
170
171 SrcDataMaxLen = SrcDataLen;
172 if (TerminateWith0)
173 SrcDataMaxLen +=
sizeof(
WCHAR);
174
175 if (*AbsoluteOffsetPtr < (
PBYTE)DataStart)
176 {
177 ERR(
"Invalid offset\n");
178 return false;
179 }
180
181 if (*AbsoluteOffsetPtr + SrcDataMaxLen > (
PBYTE)DataStart +
DataSize)
182 {
183 ERR(
"Out of bounds!\n");
184 return false;
185 }
186
187 memcpy(*AbsoluteOffsetPtr, SrcDataW, SrcDataLen);
188 *DstDataWPtr = (
WCHAR*)*AbsoluteOffsetPtr;
189 if (TerminateWith0)
190 (*DstDataWPtr)[SrcDataLen /
sizeof(
WCHAR)] = 0;
191 *AbsoluteOffsetPtr += SrcDataMaxLen;
192
193 return true;
194}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Referenced by NtlmUStrWriteToStruct().
◆ NtlmUStrAlloc()
◆ NtlmUStrFree()
◆ NtlmUStrWriteToStruct()
Definition at line 197 of file util.c.
204{
207 &DstData->Buffer,
208 SrcData->Buffer,
209 SrcData->Length,
210 AbsoluteOffsetPtr,
211 TerminateWith0))
212 return false;
213
214 DstData->Length = SrcData->Length;
215 DstData->MaximumLength = SrcData->Length;
216 if (TerminateWith0)
217 SrcData->MaximumLength +=
sizeof(
WCHAR);
218
219 return true;
220}
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....
Referenced by BuildLm20LogonProfileBuffer().
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
ntlm |
| ) |
|