ReactOS 0.4.16-dev-303-g11d5cb8
NtUserProcessConnect.c File Reference
#include "../win32nt.h"
#include <ndk/exfuncs.h>
Include dependency graph for NtUserProcessConnect.c:

Go to the source code of this file.

Macros

#define NTOS_MODE_USER
 

Functions

 START_TEST (NtUserProcessConnect)
 

Macro Definition Documentation

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 11 of file NtUserProcessConnect.c.

Function Documentation

◆ START_TEST()

START_TEST ( NtUserProcessConnect  )

Definition at line 14 of file NtUserProcessConnect.c.

15{
18 USERCONNECT UserConnect = {0};
19 SYSTEM_BASIC_INFORMATION SystemInformation;
20 ULONG_PTR MaximumUserModeAddress;
21
23
24 UserConnect.ulVersion = MAKELONG(0, 5); // == USER_VERSION
25 // UserConnect.dwDispatchCount;
26 Status = NtUserProcessConnect(hProcess, &UserConnect, sizeof(UserConnect));
28
29 printf("UserConnect.ulVersion = 0x%lx\n", UserConnect.ulVersion);
30 printf("UserConnect.ulCurrentVersion = 0x%lx\n", UserConnect.ulCurrentVersion);
31 printf("UserConnect.dwDispatchCount = 0x%lx\n", UserConnect.dwDispatchCount);
32 printf("UserConnect.siClient.psi = 0x%p\n", UserConnect.siClient.psi);
33 printf("UserConnect.siClient.aheList = 0x%p\n", UserConnect.siClient.aheList);
34 printf("UserConnect.siClient.pDispInfo = 0x%p\n", UserConnect.siClient.pDispInfo);
35 printf("UserConnect.siClient.ulSharedDelta = 0x%Ix\n", UserConnect.siClient.ulSharedDelta);
36
37 /* Verify the validity of some mandatory fields */
38 TEST(UserConnect.ulVersion == MAKELONG(0, 5));
39 TEST(UserConnect.ulCurrentVersion == 0);
40 TEST(UserConnect.siClient.ulSharedDelta != 0);
41
42 /* Get the max um address */
44 &SystemInformation,
45 sizeof(SystemInformation),
46 NULL);
48
49 MaximumUserModeAddress = SystemInformation.MaximumUserModeAddress;
50
51 /* Verify the validity of pointers -- They must be in client space */
52 TEST(UserConnect.siClient.psi != NULL);
53 TEST(UserConnect.siClient.aheList != NULL);
54 // TEST(UserConnect.siClient.pDispInfo != NULL);
55 TEST((ULONG_PTR)UserConnect.siClient.psi < MaximumUserModeAddress);
56 TEST((ULONG_PTR)UserConnect.siClient.aheList < MaximumUserModeAddress);
57 // TEST((ULONG_PTR)UserConnect.siClient.pDispInfo < MaximumUserModeAddress);
58}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define GetCurrentProcess()
Definition: compat.h:759
@ SystemBasicInformation
Definition: ntddk_ex.h:11
#define printf
Definition: freeldr.h:97
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI NtUserProcessConnect(IN HANDLE ProcessHandle, OUT PUSERCONNECT pUserConnect, IN ULONG Size)
Definition: ntstubs.c:476
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
#define TEST(x)
Definition: precomp.h:20
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
PVOID aheList
Definition: ntuser.h:1131
PSERVERINFO psi
Definition: ntuser.h:1130
PVOID pDispInfo
Definition: ntuser.h:1132
ULONG_PTR ulSharedDelta
Definition: ntuser.h:1133
ULONG ulVersion
Definition: ntuser.h:1142
DWORD dwDispatchCount
Definition: ntuser.h:1144
ULONG ulCurrentVersion
Definition: ntuser.h:1143
SHAREDINFO siClient
Definition: ntuser.h:1145
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define MAKELONG(a, b)
Definition: typedefs.h:249