28 volatile UCHAR *Pointer;
61 volatile UCHAR *Pointer;
92 ULONG OffsetsArraySize;
100 OffsetsArraySize = ArgumentCount *
sizeof(
ULONG_PTR);
130 if (CaptureBuffer ==
NULL)
return NULL;
144 return CaptureBuffer;
157 if (MessageLength == 0)
159 *CapturedData =
NULL;
165 *CapturedData = CaptureBuffer->BufferEnd;
168 if (MessageLength >=
MAXLONG)
return 0;
171 MessageLength = (MessageLength + 3) & ~3;
174 CaptureBuffer->BufferEnd = (
PVOID)((
ULONG_PTR)CaptureBuffer->BufferEnd + MessageLength);
178 CaptureBuffer->PointerOffsetsArray[CaptureBuffer->PointerCount++] = (
ULONG_PTR)CapturedData;
181 return MessageLength;
199 if (!MessageBuffer || !MessageLength)
return;
237 CapturedString->Length = 0;
243 (
PVOID*)&CapturedString->Buffer);
251 CapturedString->Length = (
USHORT)StringLength;
254 CapturedString->MaximumLength =
257 (
PVOID*)&CapturedString->Buffer);
265 if (CapturedString->Length < CapturedString->MaximumLength)
266 CapturedString->Buffer[CapturedString->Length] =
ANSI_NULL;
310 while (
Count < StringsCount)
312 if (MessageStrings[
Count])
313 Size += MessageStrings[
Count]->MaximumLength;
325 while (
Count < StringsCount)
327 if (MessageStrings[
Count])
346 if (Milliseconds == -1)
return NULL;
349 Timeout->QuadPart = Milliseconds * -10000LL;
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PLARGE_INTEGER MaximumSize
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_DATATYPE_MISALIGNMENT
ULONG_PTR PointerOffsetsArray[ANYSIZE_ARRAY]
PCSR_CAPTURE_BUFFER NTAPI CsrAllocateCaptureBuffer(_In_ ULONG ArgumentCount, _In_ ULONG BufferSize)
NTSTATUS NTAPI CsrCaptureMessageMultiUnicodeStringsInPlace(_Inout_ PCSR_CAPTURE_BUFFER *CaptureBuffer, _In_ ULONG StringsCount, _In_ PUNICODE_STRING *MessageStrings)
VOID NTAPI CsrProbeForWrite(_In_ PVOID Address, _In_ ULONG Length, _In_ ULONG Alignment)
ULONG NTAPI CsrAllocateMessagePointer(_Inout_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_ ULONG MessageLength, _Out_ PVOID *CapturedData)
VOID NTAPI CsrCaptureMessageString(_Inout_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_opt_ PCSTR String, _In_ ULONG StringLength, _In_ ULONG MaximumLength, _Out_ PSTRING CapturedString)
VOID NTAPI CsrFreeCaptureBuffer(_In_ _Frees_ptr_ PCSR_CAPTURE_BUFFER CaptureBuffer)
VOID NTAPI CsrProbeForRead(_In_ PVOID Address, _In_ ULONG Length, _In_ ULONG Alignment)
VOID NTAPI CsrCaptureMessageUnicodeStringInPlace(_Inout_ PCSR_CAPTURE_BUFFER CaptureBuffer, _Inout_ PUNICODE_STRING String)
PLARGE_INTEGER NTAPI CsrCaptureTimeout(_In_ ULONG Milliseconds, _Out_ PLARGE_INTEGER Timeout)
VOID NTAPI CsrCaptureMessageBuffer(_Inout_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_opt_ PVOID MessageBuffer, _In_ ULONG MessageLength, _Out_ PVOID *CapturedData)
#define FIELD_OFFSET(t, f)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize