31 if (UserBuffer ==
NULL)
74 UserBuffer = AllocationStart;
92 PVOID AllocationStart;
107 ((
PSIZE_T)UserBuffer)[-2] = 0xFAFBFCFD;
130 OldDataSize = ((
PSIZE_T)OldUserBuffer)[-1];
133 NewUserBuffer =
Allocate(NewDataSize);
138 return NewUserBuffer;
166 trace(
"Mismatch in region %p at index %lu. Value=%02x\n", UserBuffer, (
ULONG)
i,
Buffer[
i]);
198 trace(
"Mismatch in region %p at index %lu. Value=%02x\n", UserBuffer, (
ULONG)
i,
Buffer[
i]);
223 ok(
Size == ExpectedSize,
"Alloc of 0x%Ix: got back wrong size: 0x%Ix, expected 0x%Ix\n", InSize,
Size, ExpectedSize);
254 ok(
Size == 0x3000,
"Got back wrong size: 0x%Ix",
Size);
278 ok(
Size == 0x1000,
"Got back wrong size: 0x%Ix",
Size);
291 ok(
Size == 0x1000,
"Got back wrong size: 0x%Ix",
Size);
345 ok(
Size == 0x6000,
"Got back wrong size: 0x%Ix",
Size);
354 ok(0,
"Got exception\n");
455 ok(0,
"Got exception\n");
510 sizeof(MemoryBasicInfo),
590 ok(
BaseAddress != 0x00000000,
"Unexpected BaseAddress = 0x00000000\n");
632 ok(
FALSE,
"ToDo, 64-bit: Check/Adapt 32-bit results\n");
681 trace(
"Below 0x00400000 is available, as on ReactOS and Windows S03\n");
689 trace(
"Below 0x00400000 is not available, as on Windows XP\n");
743 skip(
"ToDo, 64-bit: Add 0x140000000/Exe and 0x180000000/DLL checks\n");
772 skip(
"Realloc failure\n");
777 Size1 = Size1 * 3 / 2;
784 skip(
"Realloc failure\n");
VOID CheckSize(ULONG_PTR Base, SIZE_T InSize, SIZE_T ExpectedSize)
static VOID ValidateAllocations(VOID)
static VOID AccessMemory1(PVOID UserBuffer, SIZE_T DataSize)
static BOOLEAN CheckMemory2(PVOID UserBuffer, SIZE_T DataSize)
static VOID CheckAdjacentVADs()
static ULONG CurrentAllocation
static VOID AccessMemory2(PVOID UserBuffer, SIZE_T DataSize)
static BOOLEAN CheckMemory1(PVOID UserBuffer, SIZE_T DataSize)
static PVOID Allocations[4096]
static PVOID ReAllocate(PVOID OldUserBuffer, SIZE_T NewDataSize)
static VOID CheckSomeDefaultAddresses(VOID)
#define EndSeh(ExpectedStatus)
#define ok_ntstatus(status, expected)
#define ok_long(expression, result)
#define ok_ptr(expression, result)
#define NT_SUCCESS(StatCode)
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
#define RtlFillMemory(Dest, Length, Fill)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
#define NtCurrentProcess()
NTSTATUS NTAPI NtFreeVirtualMemory(IN HANDLE ProcessHandle, IN PVOID *UBaseAddress, IN PSIZE_T URegionSize, IN ULONG FreeType)
NTSTATUS NTAPI NtQueryVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN MEMORY_INFORMATION_CLASS MemoryInformationClass, OUT PVOID MemoryInformation, IN SIZE_T MemoryInformationLength, OUT PSIZE_T ReturnLength)
NTSTATUS NTAPI NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UBaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect)
#define STATUS_UNABLE_TO_FREE_VM
#define STATUS_MEMORY_NOT_ALLOCATED
#define STATUS_ACCESS_VIOLATION
#define STATUS_CONFLICTING_ADDRESSES
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_opt_ PALLOCATE_FUNCTION Allocate
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
_Must_inspect_result_ NTSYSAPI SIZE_T NTAPI RtlCompareMemoryUlong(_In_reads_bytes_(Length) PVOID Source, _In_ SIZE_T Length, _In_ ULONG Pattern)