Go to the source code of this file.
◆ JOB_LIMITEDUSER_UI
Value:
#define JOB_OBJECT_UILIMIT_DESKTOP
#define JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS
#define JOB_OBJECT_UILIMIT_DISPLAYSETTINGS
#define JOB_OBJECT_UILIMIT_EXITWINDOWS
Definition at line 15 of file JobObject.c.
◆ JOB_LOCKDOWN_UI
Value:
#define JOB_LIMITEDUSER_UI
#define JOB_OBJECT_UILIMIT_WRITECLIPBOARD
#define JOB_OBJECT_UILIMIT_GLOBALATOMS
#define JOB_OBJECT_UILIMIT_HANDLES
#define JOB_OBJECT_UILIMIT_READCLIPBOARD
Definition at line 20 of file JobObject.c.
◆ SetRestrictions()
Definition at line 40 of file JobObject.c.
43{
45
46 Info.UIRestrictionsClass = Restrictions;
51}
BOOL WINAPI SetInformationJobObject(_In_ HANDLE hJob, _In_ JOBOBJECTINFOCLASS JobObjectInformationClass, _In_reads_bytes_(cbJobObjectInformationLength) LPVOID lpJobObjectInformation, _In_ DWORD cbJobObjectInformationLength)
@ JobObjectBasicUIRestrictions
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Referenced by test_Access(), test_InvalidParameters(), test_RoundTrip(), and test_SandboxPolicies().
◆ START_TEST()
Definition at line 394 of file JobObject.c.
395{
400}
static void test_Access(void)
static void test_InvalidParameters(void)
static void test_RoundTrip(void)
static void test_SandboxPolicies(void)
◆ test_Access()
Definition at line 239 of file JobObject.c.
240{
244
248 return;
249
252 hJob,
254 &hQueryOnly,
257 0);
260 {
263 ok(
Success ==
FALSE,
"Setting restrictions through a query handle succeeded\n");
265
274
276 }
277
279}
static BOOL SetRestrictions(_In_ HANDLE hJob, _In_ ULONG Restrictions)
#define ok_long(expression, result)
#define GetCurrentProcess()
#define ERROR_ACCESS_DENIED
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
HANDLE WINAPI CreateJobObjectW(_In_ LPSECURITY_ATTRIBUTES lpJobAttributes, _In_ LPCWSTR lpName)
BOOL WINAPI QueryInformationJobObject(_In_opt_ HANDLE hJob, _In_ JOBOBJECTINFOCLASS JobObjectInformationClass, _Out_writes_bytes_to_(cbJobObjectInformationLength, *lpReturnLength) LPVOID lpJobObjectInformation, _In_ DWORD cbJobObjectInformationLength, _Out_opt_ LPDWORD lpReturnLength)
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ test_InvalidParameters()
| static void test_InvalidParameters |
( |
void |
| ) |
|
|
static |
Definition at line 164 of file JobObject.c.
165{
170
174 return;
175
176
179 ok(
Success ==
FALSE,
"Setting undefined restrictions succeeded\n");
181
186
195
196
203 ok(
Success ==
FALSE,
"SetInformationJobObject with a short buffer succeeded\n");
205
211 ok(
Success ==
FALSE,
"SetInformationJobObject with a long buffer succeeded\n");
213
221 ok(
Success ==
FALSE,
"QueryInformationJobObject with a short buffer succeeded\n");
223
224
230 ok(
Success ==
FALSE,
"SetInformationJobObject with a NULL buffer succeeded\n");
232
234}
#define ERROR_INVALID_PARAMETER
#define JOB_OBJECT_UILIMIT_ALL
Referenced by START_TEST().
◆ test_RoundTrip()
Definition at line 55 of file JobObject.c.
56{
62
66 return;
67
68
80
81
83 {
89 {
90
92 continue;
93 }
94
105 {
107 }
108 else
109 {
112 }
113
114
120 {
121
122
124 continue;
125 }
126
136 }
137
138
142
151
152
155 ok(
Success !=
FALSE,
"Setting the same restrictions again failed with %lu\n",
157
158
160}
static const ULONG SingleRestrictions[]
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
Referenced by START_TEST().
◆ test_SandboxPolicies()
| static void test_SandboxPolicies |
( |
void |
| ) |
|
|
static |
Definition at line 288 of file JobObject.c.
289{
294
295
299 return;
300
301 memset(&ExtendedLimit, 0,
sizeof(ExtendedLimit));
307
311 &ExtendedLimit,
312 sizeof(ExtendedLimit));
314
317 ok(
Success !=
FALSE,
"Setting the lockdown restrictions failed with %lu\n",
319
328
330
331
335 return;
336
337 memset(&ExtendedLimit, 0,
sizeof(ExtendedLimit));
342
346 &ExtendedLimit,
347 sizeof(ExtendedLimit));
349
352 ok(
Success !=
FALSE,
"Setting the limited user restrictions failed with %lu\n",
354
363
365
366
367
368
369
370
371
375 return;
376
379 ok(
Success !=
FALSE,
"Excepting every restriction away failed with %lu\n",
381
390
392}
#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
@ JobObjectExtendedLimitInformation
#define JOB_OBJECT_LIMIT_ACTIVE_PROCESS
#define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION
Referenced by START_TEST().
◆ SingleRestrictions