ReactOS 0.4.17-dev-812-ged4f258
faultrep.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winreg.h"
#include "errorrep.h"
#include "wine/test.h"
Include dependency graph for faultrep.c:

Go to the source code of this file.

Functions

static BOOL is_process_limited (void)
 
static BOOL is_registry_virtualization_enabled (void)
 
static void test_AddERExcludedApplicationA (void)
 
 START_TEST (faultrep)
 

Variables

static const char regpath_root [] = "Software\\Microsoft\\PCHealth\\ErrorReporting"
 
static const char regpath_exclude [] = "ExclusionList"
 

Function Documentation

◆ is_process_limited()

static BOOL is_process_limited ( void  )
static

Definition at line 37 of file faultrep.c.

38{
41 DWORD size;
42
46
48}
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
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 token
Definition: glfuncs.h:210
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeLimited
Definition: winnt_old.h:2719
@ TokenElevationTypeDefault
Definition: winnt_old.h:2717
#define TOKEN_QUERY
Definition: setypes.h:940
@ TokenElevationType
Definition: setypes.h:995

Referenced by test_AddERExcludedApplicationA().

◆ is_registry_virtualization_enabled()

static BOOL is_registry_virtualization_enabled ( void  )
static

Definition at line 50 of file faultrep.c.

51{
54 DWORD size;
55
59
60 return enabled;
61}
#define FALSE
Definition: types.h:117
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
@ TokenVirtualizationEnabled
Definition: setypes.h:1001

Referenced by test_AddERExcludedApplicationA().

◆ START_TEST()

START_TEST ( faultrep  )

Definition at line 119 of file faultrep.c.

120{
122}
static void test_AddERExcludedApplicationA(void)
Definition: faultrep.c:66

◆ test_AddERExcludedApplicationA()

static void test_AddERExcludedApplicationA ( void  )
static

Definition at line 66 of file faultrep.c.

67{
68 BOOL res;
69 LONG lres;
70 HKEY hroot;
71 HKEY hexclude = 0;
72
73 /* clean state */
75
76 if (!lres)
77 lres = RegOpenKeyA(hroot, regpath_exclude, &hexclude);
78
79 if (!lres)
80 RegDeleteValueA(hexclude, "winetest_faultrep.exe");
81
82
83 SetLastError(0xdeadbeef);
85 ok(!res, "got %d and 0x%lx (expected FALSE)\n", res, GetLastError());
86
87 SetLastError(0xdeadbeef);
89 ok(!res, "got %d and 0x%lx (expected FALSE)\n", res, GetLastError());
90
91 SetLastError(0xdeadbeef);
92 /* existence of the path doesn't matter this function succeeded */
93 res = AddERExcludedApplicationA("winetest_faultrep.exe");
95 {
96 /* LastError is not set! */
98 "AddERExcludedApplicationA should have failed, got %d\n", res);
99 }
100 else
101 {
102 ok(res, "AddERExcludedApplicationA failed (le=0x%lx)\n", GetLastError());
103
104 /* add, when already present */
105 SetLastError(0xdeadbeef);
106 res = AddERExcludedApplicationA("winetest_faultrep.exe");
107 ok(res, "AddERExcludedApplicationA failed (le=0x%lx)\n", GetLastError());
108 }
109
110 /* cleanup */
111 RegDeleteValueA(hexclude, "winetest_faultrep.exe");
112
113 RegCloseKey(hexclude);
114 RegCloseKey(hroot);
115}
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define RegCloseKey(hKey)
Definition: registry.h:49
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1179
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2287
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI AddERExcludedApplicationA(LPCSTR lpAppFileName)
Definition: faultrep.c:82
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
static const char regpath_root[]
Definition: faultrep.c:33
static BOOL is_registry_virtualization_enabled(void)
Definition: faultrep.c:50
static BOOL is_process_limited(void)
Definition: faultrep.c:37
static const char regpath_exclude[]
Definition: faultrep.c:34
long LONG
Definition: pedump.c:60
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

Variable Documentation

◆ regpath_exclude

const char regpath_exclude[] = "ExclusionList"
static

Definition at line 34 of file faultrep.c.

Referenced by test_AddERExcludedApplicationA().

◆ regpath_root

const char regpath_root[] = "Software\\Microsoft\\PCHealth\\ErrorReporting"
static

Definition at line 33 of file faultrep.c.

Referenced by test_AddERExcludedApplicationA().