60 RtlFreeHeap(RtlGetProcessHeap(), 0, SysFirmwareInfo);
94 DWORD * pFirstTableID,
116 uResultSize = pEnumSystemFirmwareTables(
Signature,
Buffer, dwBufferSize);
122 ok(dwError == ErrInsuff,
123 "GetLastError() returned %ld, expected %ld\n",
128 ok(dwError == ErrSuccess,
129 "GetLastError() returned %ld, expected %ld\n",
130 dwError, ErrSuccess);
134 ok(uResultSize %
sizeof(
DWORD) == 0,
135 "uResultSize is %u, expected %% sizeof(DWORD)\n",
141 "uResultSize is %u, expected == 0\n",
147 "Buffer should be clean at offset 0, got %x\n",
161 uResultSize = pEnumSystemFirmwareTables(
Signature,
Buffer, dwBufferSize);
167 ok(dwError == ErrInsuff,
168 "GetLastError() returned %ld, expected %ld\n",
173 ok(dwError == ErrSuccess,
174 "GetLastError() returned %ld, expected %ld\n",
175 dwError, ErrSuccess);
179 ok(uResultSize %
sizeof(
DWORD) == 0,
180 "uResultSize is %u, expected %% sizeof(DWORD)\n",
186 "uResultSize is %u, expected == 0\n",
192 "Buffer should be clean at offset 0, got %x\n",
205 dwBufferSize = uResultSize;
208 uResultSize = pEnumSystemFirmwareTables(
Signature,
Buffer, dwBufferSize);
215 ok(dwError == ErrSuccess,
216 "GetLastError() returned %ld, expected %ld\n",
217 dwError, ErrSuccess);
220 ok(uResultSize == dwBufferSize,
221 "uResultSize is not equal dwBufferSize, expected %ld\n",
227 "uResultSize is %u, expected == 0\n",
234 ok(dwError == 0xbeeffeed,
235 "GetLastError() returned %ld, expected %u\n",
236 dwError, 0xbeeffeed);
239 "uResultSize is %u, expected == 0\n",
244 if (pTableCount && pFirstTableID)
252 "Buffer should be filled at offset 0, got %lx\n",
261 "Buffer should be filled at offset 0\n");
266 "Buffer should be clean at offset 0\n");
270 *pTableCount = uResultSize /
sizeof(
DWORD);
308 dwErrCase = ErrInsuff;
322 uResultSize = pGetSystemFirmwareTable(
Signature, TableID,
Buffer, dwBufferSize);
326 ok(dwError == (TestFakeID ? dwErrCase : ErrInsuff),
327 "GetLastError() returned %ld, expected %ld\n",
328 dwError, (TestFakeID ? dwErrCase : ErrInsuff));
329 if (ErrSuccess ==
ERROR_SUCCESS && (!TestFakeID || dwErrCase == ErrInsuff))
332 "uResultSize is %u, expected > 0\n",
338 "uResultSize is %u, expected == 0\n",
344 "Buffer should be clean at offset 0, got %x\n",
358 uResultSize = pGetSystemFirmwareTable(
Signature, TableID,
Buffer, dwBufferSize);
362 ok(dwError == (TestFakeID ? dwErrCase : ErrInsuff),
363 "GetLastError() returned %ld, expected %ld\n",
364 dwError, (TestFakeID ? dwErrCase : ErrInsuff));
365 if (ErrSuccess ==
ERROR_SUCCESS && (!TestFakeID || dwErrCase == ErrInsuff))
368 "uResultSize is %u, expected > 0\n",
374 "uResultSize is %u, expected == 0\n",
380 "Buffer should be clean at offset 0, got %x\n",
389 if (uResultSize == 0)
395 dwBufferSize = uResultSize;
398 uResultSize = pGetSystemFirmwareTable(
Signature, TableID,
Buffer, dwBufferSize);
405 ok(dwError == ErrSuccess,
406 "GetLastError() returned %ld, expected %ld\n",
407 dwError, ErrSuccess);
410 ok(uResultSize == dwBufferSize,
411 "uResultSize is not equal dwBufferSize, expected %ld\n",
417 "uResultSize is %u, expected == 0\n",
424 ok(dwError == 0xbeeffeed,
425 "GetLastError() returned %ld, expected %u\n",
426 dwError, 0xbeeffeed);
429 "uResultSize is %u, expected == 0\n",
438 "Buffer should be filled at offset 0\n");
443 "Buffer should be clean at offset 0\n");
492 if (TableCount[
i] == 0)
498 skip(
"No tables for %s found. Skipping\n",
522 skip(
"kernel32.dll module not found. Can't proceed\n");
531 pEnumSystemFirmwareTables = (
void *)
GetProcAddress(hKernel,
"EnumSystemFirmwareTables");
532 pGetSystemFirmwareTable = (
void *)
GetProcAddress(hKernel,
"GetSystemFirmwareTable");
534 if (!pEnumSystemFirmwareTables)
536 skip(
"EnumSystemFirmwareTables not found. Can't proceed\n");
539 if (!pGetSystemFirmwareTable)
541 skip(
"GetSystemFirmwareTable not found. Can't proceed\n");
static const ENTRY Entries[]
static VOID test_GetBuffer(DWORD Signature, DWORD TableID, PVOID Buffer, DWORD dwSize, BOOL TestFakeID, DWORD ErrInsuff, DWORD ErrSuccess)
static VOID test_EnumBuffer(DWORD Signature, PVOID Buffer, DWORD dwSize, UINT *pTableCount, DWORD *pFirstTableID, DWORD ErrInsuff, DWORD ErrSuccess)
static UINT CallNt(IN DWORD FirmwareTableProviderSignature, IN DWORD FirmwareTableID, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize, IN SYSTEM_FIRMWARE_TABLE_ACTION Action)
UINT WINAPI fEnumSystemFirmwareTables(IN DWORD FirmwareTableProviderSignature, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize)
UINT WINAPI fGetSystemFirmwareTable(IN DWORD FirmwareTableProviderSignature, IN DWORD FirmwareTableID, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize)
static VOID test_Functions()
#define EndSeh(ExpectedStatus)
_In_ ULONG FirmwareTableID
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)
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_INVALID_FUNCTION
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
static const WCHAR Signature[]
#define FillMemory(BUF, SIZ, MASK)
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
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
_Check_return_ unsigned long __cdecl _byteswap_ulong(_In_ unsigned long)
#define memcpy(s1, s2, n)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
@ SystemFirmwareTableInformation
@ SystemFirmwareTable_Enumerate
@ SystemFirmwareTable_Get
enum _SYSTEM_FIRMWARE_TABLE_ACTION SYSTEM_FIRMWARE_TABLE_ACTION
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION SYSTEM_FIRMWARE_TABLE_INFORMATION
#define STATUS_ACCESS_VIOLATION
#define STATUS_BUFFER_TOO_SMALL
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
DWORD WINAPI GetLastError(void)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO