Commit b3504380 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Implemented NtQueryObject and NtSetInformationObject for the

ObjectDataInformation class.
parent ce533003
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
@ stub NtSetHighWaitLowThread @ stub NtSetHighWaitLowThread
@ stdcall NtSetInformationFile(long long long long long) @ stdcall NtSetInformationFile(long long long long long)
@ stdcall NtSetInformationKey(long long ptr long) @ stdcall NtSetInformationKey(long long ptr long)
@ stub NtSetInformationObject @ stdcall NtSetInformationObject(long long ptr long)
@ stdcall NtSetInformationProcess(long long long long) @ stdcall NtSetInformationProcess(long long long long)
@ stdcall NtSetInformationThread(long long long long) @ stdcall NtSetInformationThread(long long long long)
@ stub NtSetInformationToken @ stub NtSetInformationToken
...@@ -742,7 +742,7 @@ ...@@ -742,7 +742,7 @@
@ stub ZwSetHighWaitLowThread @ stub ZwSetHighWaitLowThread
@ stdcall ZwSetInformationFile(long long long long long) NtSetInformationFile @ stdcall ZwSetInformationFile(long long long long long) NtSetInformationFile
@ stdcall ZwSetInformationKey(long long ptr long) NtSetInformationKey @ stdcall ZwSetInformationKey(long long ptr long) NtSetInformationKey
@ stub ZwSetInformationObject @ stdcall ZwSetInformationObject(long long ptr long) NtSetInformationObject
@ stdcall ZwSetInformationProcess(long long long long) NtSetInformationProcess @ stdcall ZwSetInformationProcess(long long long long) NtSetInformationProcess
@ stdcall ZwSetInformationThread(long long long long) NtSetInformationThread @ stdcall ZwSetInformationThread(long long long long) NtSetInformationThread
@ stub ZwSetInformationToken @ stub ZwSetInformationToken
......
...@@ -47,16 +47,91 @@ typedef void * POBJDIR_INFORMATION; ...@@ -47,16 +47,91 @@ typedef void * POBJDIR_INFORMATION;
* NtQueryObject [NTDLL.@] * NtQueryObject [NTDLL.@]
* ZwQueryObject [NTDLL.@] * ZwQueryObject [NTDLL.@]
*/ */
NTSTATUS WINAPI NtQueryObject( NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
IN HANDLE ObjectHandle, IN OBJECT_INFORMATION_CLASS info_class,
IN OBJECT_INFORMATION_CLASS ObjectInformationClass, OUT PVOID ptr, IN ULONG len, OUT PULONG used_len)
OUT PVOID ObjectInformation,
IN ULONG Length,
OUT PULONG ResultLength)
{ {
FIXME("(%p,0x%08x,%p,0x%08lx,%p): stub\n", NTSTATUS status;
ObjectHandle, ObjectInformationClass, ObjectInformation, Length, ResultLength);
return 0; TRACE("(%p,0x%08x,%p,0x%08lx,%p): stub\n",
handle, info_class, ptr, len, used_len);
if (used_len) *used_len = 0;
switch (info_class)
{
case ObjectDataInformation:
{
OBJECT_DATA_INFORMATION* p = (OBJECT_DATA_INFORMATION*)ptr;
if (len < sizeof(*p)) return STATUS_INVALID_BUFFER_SIZE;
SERVER_START_REQ( set_handle_info )
{
req->handle = handle;
req->flags = 0;
req->mask = 0;
req->fd = -1;
status = wine_server_call( req );
if (status == STATUS_SUCCESS)
{
p->InheritHandle = (reply->old_flags & HANDLE_FLAG_INHERIT) ? TRUE : FALSE;
p->ProtectFromClose = (reply->old_flags & HANDLE_FLAG_PROTECT_FROM_CLOSE) ? TRUE : FALSE;
if (used_len) *used_len = sizeof(*p);
}
}
SERVER_END_REQ;
}
break;
default:
FIXME("Unsupported information class %u\n", info_class);
status = STATUS_NOT_IMPLEMENTED;
break;
}
return status;
}
/******************************************************************
* NtSetInformationObject [NTDLL.@]
* ZwSetInformationObject [NTDLL.@]
*
*/
NTSTATUS WINAPI NtSetInformationObject(IN HANDLE handle,
IN OBJECT_INFORMATION_CLASS info_class,
IN PVOID ptr, IN ULONG len)
{
NTSTATUS status;
TRACE("(%p,0x%08x,%p,0x%08lx): stub\n",
handle, info_class, ptr, len);
switch (info_class)
{
case ObjectDataInformation:
{
OBJECT_DATA_INFORMATION* p = (OBJECT_DATA_INFORMATION*)ptr;
if (len < sizeof(*p)) return STATUS_INVALID_BUFFER_SIZE;
SERVER_START_REQ( set_handle_info )
{
req->handle = handle;
req->flags = 0;
req->mask = HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE;
req->fd = -1;
if (p->InheritHandle) req->flags |= HANDLE_FLAG_INHERIT;
if (p->ProtectFromClose) req->flags |= HANDLE_FLAG_PROTECT_FROM_CLOSE;
status = wine_server_call( req );
}
SERVER_END_REQ;
}
break;
default:
FIXME("Unsupported information class %u\n", info_class);
status = STATUS_NOT_IMPLEMENTED;
break;
}
return status;
} }
/****************************************************************************** /******************************************************************************
......
...@@ -229,7 +229,11 @@ typedef enum _KEY_VALUE_INFORMATION_CLASS { ...@@ -229,7 +229,11 @@ typedef enum _KEY_VALUE_INFORMATION_CLASS {
} KEY_VALUE_INFORMATION_CLASS; } KEY_VALUE_INFORMATION_CLASS;
typedef enum _OBJECT_INFORMATION_CLASS { typedef enum _OBJECT_INFORMATION_CLASS {
DunnoTheConstants1 /* FIXME */ ObjectBasicInformation,
ObjectNameInformation,
ObjectTypeInformation,
ObjectAllInformation,
ObjectDataInformation
} OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS; } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
typedef enum _PROCESSINFOCLASS { typedef enum _PROCESSINFOCLASS {
...@@ -499,6 +503,11 @@ typedef struct _OBJECT_ATTRIBUTES { ...@@ -499,6 +503,11 @@ typedef struct _OBJECT_ATTRIBUTES {
PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */ PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
typedef struct _OBJECT_DATA_INFORMATION {
BOOLEAN InheritHandle;
BOOLEAN ProtectFromClose;
} OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
typedef struct _PROCESS_BASIC_INFORMATION { typedef struct _PROCESS_BASIC_INFORMATION {
#ifdef __WINESRC__ #ifdef __WINESRC__
DWORD ExitStatus; DWORD ExitStatus;
...@@ -896,6 +905,7 @@ NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PUL ...@@ -896,6 +905,7 @@ NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PUL
NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD); NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *); NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG); NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER); NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
...@@ -913,6 +923,7 @@ NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*); ...@@ -913,6 +923,7 @@ NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID); NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG); NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG); NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*); NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*); NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment