[USP10_WINETEST] Sync with Wine Staging 2.9. CORE-13362
[reactos.git] / rostests / kmtests / include / kmt_test_user.h
1 /*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite test framework declarations
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8 #ifndef _KMTEST_TEST_USER_H_
9 #define _KMTEST_TEST_USER_H_
10
11 #if !defined _KMTEST_TEST_H_
12 #error include kmt_test.h instead of including kmt_test_user.h
13 #endif /* !defined _KMTEST_TEST_H_ */
14
15 static PKMT_RESULTBUFFER KmtAllocateResultBuffer(SIZE_T ResultBufferSize)
16 {
17 PKMT_RESULTBUFFER Buffer = HeapAlloc(GetProcessHeap(), 0, ResultBufferSize);
18 if (!Buffer)
19 return NULL;
20
21 Buffer->Successes = 0;
22 Buffer->Failures = 0;
23 Buffer->Skipped = 0;
24 Buffer->LogBufferLength = 0;
25 Buffer->LogBufferMaxLength = (ULONG)ResultBufferSize - FIELD_OFFSET(KMT_RESULTBUFFER, LogBuffer);
26
27 return Buffer;
28 }
29
30 static VOID KmtFreeResultBuffer(PKMT_RESULTBUFFER Buffer)
31 {
32 HeapFree(GetProcessHeap(), 0, Buffer);
33 }
34
35 #define KmtVSNPrintF vsnprintf
36
37 #endif /* !defined _KMTEST_TEST_USER_H_ */