Paul Gofman : ntdll: Add stub for ProcessInstrumentationCallback info class in NtSetInformationProcess().
Alexandre Julliard
julliard at winehq.org
Mon Jul 19 15:59:16 CDT 2021
Module: wine
Branch: master
Commit: 20fff538c49c87abffd583f6b63371592ebdd835
URL: https://source.winehq.org/git/wine.git/?a=commit;h=20fff538c49c87abffd583f6b63371592ebdd835
Author: Paul Gofman <pgofman at codeweavers.com>
Date: Mon Jul 19 15:16:29 2021 +0300
ntdll: Add stub for ProcessInstrumentationCallback info class in NtSetInformationProcess().
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/tests/info.c | 27 +++++++++++++++++++++++++++
dlls/ntdll/unix/process.c | 11 +++++++++++
include/winternl.h | 7 +++++++
3 files changed, 45 insertions(+)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 85e27e92663..a00cb5a6a5b 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -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 );
}
+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)
{
char **argv;
@@ -3322,4 +3348,5 @@ START_TEST(info)
test_NtGetCurrentProcessorNumber();
test_ThreadEnableAlignmentFaultFixup();
+ test_process_instrumentation_callback();
}
diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c
index 77fb81fe404..2cd91974462 100644
--- a/dlls/ntdll/unix/process.c
+++ b/dlls/ntdll/unix/process.c
@@ -1485,6 +1485,17 @@ NTSTATUS WINAPI NtSetInformationProcess( HANDLE handle, PROCESSINFOCLASS class,
}
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:
{
void *addr = NULL;
diff --git a/include/winternl.h b/include/winternl.h
index c632328b322..09804a21571 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1472,6 +1472,13 @@ typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
#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 {
FileFsVolumeInformation = 1,
FileFsLabelInformation,
More information about the wine-cvs
mailing list