ntdll: Add stub for ProcessInstrumentationCallback info class in NtSetInformationProcess().

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-07-19 15:16:29 +03:00 committed by Alexandre Julliard
parent b335b69368
commit 20fff538c4
3 changed files with 45 additions and 0 deletions

View File

@ -3256,6 +3256,32 @@ static void test_debug_object(void)
ok( event.u.LoadDll.fUnicode == TRUE, "event not updated %x\n", event.u.LoadDll.fUnicode ); ok( event.u.LoadDll.fUnicode == TRUE, "event not updated %x\n", event.u.LoadDll.fUnicode );
} }
static void test_process_instrumentation_callback(void)
{
PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION info;
NTSTATUS status;
status = NtSetInformationProcess( GetCurrentProcess(), ProcessInstrumentationCallback, NULL, 0 );
ok( status == STATUS_INFO_LENGTH_MISMATCH /* Win10 */ || status == STATUS_INVALID_INFO_CLASS
|| status == STATUS_NOT_SUPPORTED, "Got unexpected status %#x.\n", status );
if (status != STATUS_INFO_LENGTH_MISMATCH)
{
win_skip( "ProcessInstrumentationCallback is not supported.\n" );
return;
}
memset(&info, 0, sizeof(info));
status = NtSetInformationProcess( GetCurrentProcess(), ProcessInstrumentationCallback, &info, sizeof(info) );
ok( status == STATUS_SUCCESS /* Win 10 */ || broken( status == STATUS_PRIVILEGE_NOT_HELD )
|| broken( status == STATUS_INFO_LENGTH_MISMATCH ), "Got unexpected status %#x.\n", status );
memset(&info, 0, sizeof(info));
status = NtSetInformationProcess( GetCurrentProcess(), ProcessInstrumentationCallback, &info, 2 * sizeof(info) );
ok( status == STATUS_SUCCESS || status == STATUS_INFO_LENGTH_MISMATCH
|| broken( status == STATUS_PRIVILEGE_NOT_HELD ) /* some versions and machines before Win10 */,
"Got unexpected status %#x.\n", status );
}
START_TEST(info) START_TEST(info)
{ {
char **argv; char **argv;
@ -3322,4 +3348,5 @@ START_TEST(info)
test_NtGetCurrentProcessorNumber(); test_NtGetCurrentProcessorNumber();
test_ThreadEnableAlignmentFaultFixup(); test_ThreadEnableAlignmentFaultFixup();
test_process_instrumentation_callback();
} }

View File

@ -1485,6 +1485,17 @@ NTSTATUS WINAPI NtSetInformationProcess( HANDLE handle, PROCESSINFOCLASS class,
} }
break; break;
case ProcessInstrumentationCallback:
{
PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION *instr = info;
FIXME( "ProcessInstrumentationCallback stub.\n" );
if (size < sizeof(*instr)) return STATUS_INFO_LENGTH_MISMATCH;
ret = STATUS_SUCCESS;
break;
}
case ProcessThreadStackAllocation: case ProcessThreadStackAllocation:
{ {
void *addr = NULL; void *addr = NULL;

View File

@ -1472,6 +1472,13 @@ typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
#define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4 #define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
typedef struct _PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION
{
ULONG Version;
ULONG Reserved;
VOID *Callback;
} PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION, *PPROCESS_INSTRUMENTATION_CALLBACK_INFORMATION;
typedef enum _FSINFOCLASS { typedef enum _FSINFOCLASS {
FileFsVolumeInformation = 1, FileFsVolumeInformation = 1,
FileFsLabelInformation, FileFsLabelInformation,