ReactOS  0.4.14-dev-614-gbfd8a84
SaferIdentifyLevel.c File Reference
#include "precomp.h"
#include <winsafer.h>
Include dependency graph for SaferIdentifyLevel.c:

Go to the source code of this file.

Macros

#define SaferIdentifyLevel(c, p, h, r)   SaferIdentifyLevel(c, (PSAFER_CODE_PROPERTIES)(p), h, r)
 

Functions

 START_TEST (SaferIdentifyLevel)
 

Macro Definition Documentation

◆ SaferIdentifyLevel

#define SaferIdentifyLevel (   c,
  p,
  h,
  r 
)    SaferIdentifyLevel(c, (PSAFER_CODE_PROPERTIES)(p), h, r)

Definition at line 12 of file SaferIdentifyLevel.c.

Function Documentation

◆ START_TEST()

START_TEST ( SaferIdentifyLevel  )

Definition at line 14 of file SaferIdentifyLevel.c.

15 {
16  BOOL ret;
17  DWORD error;
18  SAFER_LEVEL_HANDLE handle;
20 
21  StartSeh()
22  SetLastError(0xbadbad00);
24  error = GetLastError();
25  ok(ret == FALSE, "ret = %d\n", ret);
26  ok(error == ERROR_NOACCESS, "error = %lu\n", error);
28 
29  StartSeh()
32 
33  StartSeh()
35  SetLastError(0xbadbad00);
37  error = GetLastError();
38  ok(ret == FALSE, "ret = %d\n", ret);
39  ok(error == ERROR_BAD_LENGTH, "error = %lu\n", error);
41 
42  StartSeh()
44  SetLastError(0xbadbad00);
46  error = GetLastError();
47  ok(ret == FALSE, "ret = %d\n", ret);
48  ok(error == ERROR_NOACCESS, "error = %lu\n", error);
50 
51  StartSeh()
54  SetLastError(0xbadbad00);
56  error = GetLastError();
57  ok(ret == FALSE, "ret = %d\n", ret);
58  ok(handle == InvalidPointer, "handle = %p\n", handle);
59  ok(error == ERROR_BAD_LENGTH, "error = %lu\n", error);
63 
64  /* Struct sizes */
65  StartSeh()
69  SetLastError(0xbadbad00);
71  error = GetLastError();
72  ok(ret == TRUE, "ret = %d\n", ret);
74  ok(error == 0xbadbad00, "error = %lu\n", error);
76  {
78  ok(ret == TRUE, "ret = %d\n", ret);
79  }
81 
82  StartSeh()
86  SetLastError(0xbadbad00);
88  error = GetLastError();
89  ok(ret == FALSE, "ret = %d\n", ret);
90  ok(handle == InvalidPointer, "handle = %p\n", handle);
91  ok(error == ERROR_BAD_LENGTH, "error = %lu\n", error);
95 
96  /* Test SaferCloseLevel too */
97  StartSeh()
99  error = GetLastError();
100  ok(ret == FALSE, "ret = %d\n", ret);
101  ok(error == ERROR_INVALID_HANDLE, "error = %lu\n", error);
103 
104  StartSeh()
106  error = GetLastError();
107  ok(ret == FALSE, "ret = %d\n", ret);
108  ok(error == ERROR_INVALID_HANDLE, "error = %lu\n", error);
110 
111  StartSeh()
113  error = GetLastError();
114  ok(ret == FALSE, "ret = %d\n", ret);
115  ok(error == ERROR_INVALID_HANDLE, "error = %lu\n", error);
117 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define TRUE
Definition: types.h:120
#define error(str)
Definition: mkdosfs.c:1605
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define ERROR_BAD_LENGTH
Definition: winerror.h:127
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
GLdouble n
Definition: glext.h:7729
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1642
#define StartSeh()
Definition: _sntprintf.h:16
#define ERROR_NOACCESS
Definition: winerror.h:578
BOOL WINAPI SaferCloseLevel(_In_ SAFER_LEVEL_HANDLE hLevelHandle)
Definition: safer.c:80
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define InvalidPointer
#define d
Definition: ke_i.h:81
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
#define SaferIdentifyLevel(c, p, h, r)
int ret
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
#define ok(value,...)
Definition: atltest.h:57
static const WCHAR props[]
Definition: wbemdisp.c:288
GLfloat GLfloat p
Definition: glext.h:8902
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define EndSeh(ExpectedStatus)
Definition: _sntprintf.h:17