Commit 5267fcca authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ktmw32: Use syscall interface for transaction objects stubs.

parent 470723d7
...@@ -22,39 +22,59 @@ ...@@ -22,39 +22,59 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/debug.h" #include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL(ktmw32); static inline BOOL set_ntstatus( NTSTATUS status )
{
if (status) RtlSetLastWin32Error( RtlNtStatusToDosError( status ));
return !status;
}
static inline LARGE_INTEGER *get_nt_timeout( LARGE_INTEGER *time, DWORD timeout )
{
if (timeout == INFINITE) return NULL;
time->QuadPart = (ULONGLONG)timeout * -10000;
return time;
}
/*********************************************************************** /***********************************************************************
* CommitTransaction (ktmw32.@) * CommitTransaction (ktmw32.@)
*/ */
BOOL WINAPI CommitTransaction(HANDLE transaction) BOOL WINAPI CommitTransaction(HANDLE transaction)
{ {
FIXME("(%p): stub\n", transaction); return set_ntstatus( NtCommitTransaction( transaction, TRUE ));
return TRUE;
} }
/*********************************************************************** /***********************************************************************
* CreateTransaction (ktmw32.@) * CreateTransaction (ktmw32.@)
*/ */
HANDLE WINAPI CreateTransaction(LPSECURITY_ATTRIBUTES pattr, LPGUID pguid, DWORD options, HANDLE WINAPI CreateTransaction( SECURITY_ATTRIBUTES *sa, GUID *guid, DWORD options, DWORD level, DWORD flags,
DWORD level, DWORD flags, DWORD timeout, LPWSTR description) DWORD timeout, WCHAR *desc )
{ {
ULONG obj_flags = OBJ_CASE_INSENSITIVE;
UNICODE_STRING desc_str;
OBJECT_ATTRIBUTES attr;
LARGE_INTEGER time;
HANDLE handle;
if (sa && sa->bInheritHandle) obj_flags |= OBJ_INHERIT;
InitializeObjectAttributes( &attr, NULL, obj_flags, 0, sa ? sa->lpSecurityDescriptor : NULL );
RtlInitUnicodeString( &desc_str, desc );
FIXME("(%p %p 0x%lx 0x%lx 0x%lx, %lu, %s): stub\n", if (!set_ntstatus( NtCreateTransaction( &handle, 0 /* FIXME */, &attr, guid, NULL, options, level, flags,
pattr, pguid, options, level, flags, timeout, debugstr_w(description)); get_nt_timeout( &time, timeout ), &desc_str )))
{
return INVALID_HANDLE_VALUE;
}
return (HANDLE) 1; return handle;
} }
/*********************************************************************** /***********************************************************************
* Rollback Transaction (ktmw32.@) * RollbackTransaction (ktmw32.@)
*/ */
BOOL WINAPI RollbackTransaction(HANDLE transaction) BOOL WINAPI RollbackTransaction(HANDLE transaction)
{ {
FIXME("stub: %p\n", transaction); return set_ntstatus( NtRollbackTransaction( transaction, TRUE ));
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
} }
...@@ -158,6 +158,7 @@ ...@@ -158,6 +158,7 @@
@ stdcall -syscall NtClearEvent(long) @ stdcall -syscall NtClearEvent(long)
@ stdcall -syscall NtClose(long) @ stdcall -syscall NtClose(long)
# @ stub NtCloseObjectAuditAlarm # @ stub NtCloseObjectAuditAlarm
@ stdcall -syscall NtCommitTransaction(long long)
# @ stub NtCompactKeys # @ stub NtCompactKeys
@ stdcall -syscall NtCompareObjects(ptr ptr) @ stdcall -syscall NtCompareObjects(ptr ptr)
# @ stub NtCompareTokens # @ stub NtCompareTokens
...@@ -192,6 +193,7 @@ ...@@ -192,6 +193,7 @@
@ stdcall -syscall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr) @ stdcall -syscall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr)
@ stdcall -syscall NtCreateTimer(ptr long ptr long) @ stdcall -syscall NtCreateTimer(ptr long ptr long)
# @ stub NtCreateToken # @ stub NtCreateToken
@ stdcall -syscall NtCreateTransaction(ptr long ptr ptr long long long long ptr ptr)
@ stdcall -syscall NtCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr) @ stdcall -syscall NtCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr)
# @ stub NtCreateWaitablePort # @ stub NtCreateWaitablePort
@ stdcall -arch=i386,arm64 NtCurrentTeb() @ stdcall -arch=i386,arm64 NtCurrentTeb()
...@@ -365,6 +367,7 @@ ...@@ -365,6 +367,7 @@
@ stdcall -syscall NtRestoreKey(long long long) @ stdcall -syscall NtRestoreKey(long long long)
@ stdcall -syscall NtResumeProcess(long) @ stdcall -syscall NtResumeProcess(long)
@ stdcall -syscall NtResumeThread(long ptr) @ stdcall -syscall NtResumeThread(long ptr)
@ stdcall -syscall NtRollbackTransaction(long long)
@ stdcall -syscall NtSaveKey(long long) @ stdcall -syscall NtSaveKey(long long)
# @ stub NtSaveKeyEx # @ stub NtSaveKeyEx
# @ stub NtSaveMergedKeys # @ stub NtSaveMergedKeys
......
...@@ -143,6 +143,7 @@ static void * const syscalls[] = ...@@ -143,6 +143,7 @@ static void * const syscalls[] =
NtCancelTimer, NtCancelTimer,
NtClearEvent, NtClearEvent,
NtClose, NtClose,
NtCommitTransaction,
NtCompareObjects, NtCompareObjects,
NtCompleteConnectPort, NtCompleteConnectPort,
NtConnectPort, NtConnectPort,
...@@ -168,6 +169,7 @@ static void * const syscalls[] = ...@@ -168,6 +169,7 @@ static void * const syscalls[] =
NtCreateThread, NtCreateThread,
NtCreateThreadEx, NtCreateThreadEx,
NtCreateTimer, NtCreateTimer,
NtCreateTransaction,
NtCreateUserProcess, NtCreateUserProcess,
NtDebugActiveProcess, NtDebugActiveProcess,
NtDebugContinue, NtDebugContinue,
...@@ -296,6 +298,7 @@ static void * const syscalls[] = ...@@ -296,6 +298,7 @@ static void * const syscalls[] =
NtRestoreKey, NtRestoreKey,
NtResumeProcess, NtResumeProcess,
NtResumeThread, NtResumeThread,
NtRollbackTransaction,
NtSaveKey, NtSaveKey,
NtSecureConnectPort, NtSecureConnectPort,
NtSetContextThread, NtSetContextThread,
......
...@@ -2561,3 +2561,37 @@ void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR i ...@@ -2561,3 +2561,37 @@ void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR i
return; return;
} }
/***********************************************************************
* NtCreateTransaction (NTDLL.@)
*/
NTSTATUS WINAPI NtCreateTransaction( HANDLE *handle, ACCESS_MASK mask, OBJECT_ATTRIBUTES *obj_attr, GUID *guid, HANDLE tm,
ULONG options, ULONG isol_level, ULONG isol_flags, PLARGE_INTEGER timeout, UNICODE_STRING *description )
{
FIXME( "%p, %#x, %p, %s, %p, 0x%08x, 0x%08x, 0x%08x, %p, %p stub.\n", handle, (int)mask, obj_attr, debugstr_guid(guid), tm,
(int)options, (int)isol_level, (int)isol_flags, timeout, description );
*handle = ULongToHandle(1);
return STATUS_SUCCESS;
}
/***********************************************************************
* NtCommitTransaction (NTDLL.@)
*/
NTSTATUS WINAPI NtCommitTransaction( HANDLE transaction, BOOLEAN wait )
{
FIXME( "%p, %d stub.\n", transaction, wait );
return STATUS_SUCCESS;
}
/***********************************************************************
* NtRollbackTransaction (NTDLL.@)
*/
NTSTATUS WINAPI NtRollbackTransaction( HANDLE transaction, BOOLEAN wait )
{
FIXME( "%p, %d stub.\n", transaction, wait );
return STATUS_ACCESS_VIOLATION;
}
...@@ -1617,3 +1617,57 @@ NTSTATUS WINAPI wow64_NtYieldExecution( UINT *args ) ...@@ -1617,3 +1617,57 @@ NTSTATUS WINAPI wow64_NtYieldExecution( UINT *args )
{ {
return NtYieldExecution(); return NtYieldExecution();
} }
/**********************************************************************
* wow64_NtCreateTransaction
*/
NTSTATUS WINAPI wow64_NtCreateTransaction( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
GUID *guid = get_ptr( &args );
HANDLE tm = get_handle( &args );
ULONG options = get_ulong( &args );
ULONG isol_level = get_ulong( &args );
ULONG isol_flags = get_ulong( &args );
LARGE_INTEGER *timeout = get_ptr( &args );
UNICODE_STRING32 *desc32 = get_ptr( &args );
struct object_attr64 attr;
UNICODE_STRING desc;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtCreateTransaction( &handle, access, objattr_32to64( &attr, attr32 ), guid, tm, options,
isol_level, isol_flags, timeout, unicode_str_32to64( &desc, desc32 ));
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtCommitTransaction
*/
NTSTATUS WINAPI wow64_NtCommitTransaction( UINT *args )
{
HANDLE handle = get_handle( &args );
BOOLEAN wait = get_ulong( &args );
return NtCommitTransaction( handle, wait );
}
/**********************************************************************
* wow64_NtRollbackTransaction
*/
NTSTATUS WINAPI wow64_NtRollbackTransaction( UINT *args )
{
HANDLE handle = get_handle( &args );
BOOLEAN wait = get_ulong( &args );
return NtRollbackTransaction( handle, wait );
}
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
SYSCALL_ENTRY( NtCancelTimer ) \ SYSCALL_ENTRY( NtCancelTimer ) \
SYSCALL_ENTRY( NtClearEvent ) \ SYSCALL_ENTRY( NtClearEvent ) \
SYSCALL_ENTRY( NtClose ) \ SYSCALL_ENTRY( NtClose ) \
SYSCALL_ENTRY( NtCommitTransaction ) \
SYSCALL_ENTRY( NtCompareObjects ) \ SYSCALL_ENTRY( NtCompareObjects ) \
SYSCALL_ENTRY( NtCompleteConnectPort ) \ SYSCALL_ENTRY( NtCompleteConnectPort ) \
SYSCALL_ENTRY( NtConnectPort ) \ SYSCALL_ENTRY( NtConnectPort ) \
...@@ -69,6 +70,7 @@ ...@@ -69,6 +70,7 @@
SYSCALL_ENTRY( NtCreateThread ) \ SYSCALL_ENTRY( NtCreateThread ) \
SYSCALL_ENTRY( NtCreateThreadEx ) \ SYSCALL_ENTRY( NtCreateThreadEx ) \
SYSCALL_ENTRY( NtCreateTimer ) \ SYSCALL_ENTRY( NtCreateTimer ) \
SYSCALL_ENTRY( NtCreateTransaction ) \
SYSCALL_ENTRY( NtCreateUserProcess ) \ SYSCALL_ENTRY( NtCreateUserProcess ) \
SYSCALL_ENTRY( NtDebugActiveProcess ) \ SYSCALL_ENTRY( NtDebugActiveProcess ) \
SYSCALL_ENTRY( NtDebugContinue ) \ SYSCALL_ENTRY( NtDebugContinue ) \
...@@ -197,6 +199,7 @@ ...@@ -197,6 +199,7 @@
SYSCALL_ENTRY( NtRestoreKey ) \ SYSCALL_ENTRY( NtRestoreKey ) \
SYSCALL_ENTRY( NtResumeProcess ) \ SYSCALL_ENTRY( NtResumeProcess ) \
SYSCALL_ENTRY( NtResumeThread ) \ SYSCALL_ENTRY( NtResumeThread ) \
SYSCALL_ENTRY( NtRollbackTransaction ) \
SYSCALL_ENTRY( NtSaveKey ) \ SYSCALL_ENTRY( NtSaveKey ) \
SYSCALL_ENTRY( NtSecureConnectPort ) \ SYSCALL_ENTRY( NtSecureConnectPort ) \
SYSCALL_ENTRY( NtSetContextThread ) \ SYSCALL_ENTRY( NtSetContextThread ) \
......
...@@ -3983,6 +3983,7 @@ NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*); ...@@ -3983,6 +3983,7 @@ NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE); NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE); NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN); NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
NTSYSAPI NTSTATUS WINAPI NtCommitTransaction(HANDLE,BOOLEAN);
NTSYSAPI NTSTATUS WINAPI NtCompareObjects(HANDLE,HANDLE); NTSYSAPI NTSTATUS WINAPI NtCompareObjects(HANDLE,HANDLE);
NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE); NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG); NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
...@@ -4012,6 +4013,7 @@ NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES, ...@@ -4012,6 +4013,7 @@ NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,
NTSYSAPI NTSTATUS WINAPI NtCreateThreadEx(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,HANDLE,PRTL_THREAD_START_ROUTINE,void*,ULONG,ULONG_PTR,SIZE_T,SIZE_T,PS_ATTRIBUTE_LIST*); NTSYSAPI NTSTATUS WINAPI NtCreateThreadEx(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,HANDLE,PRTL_THREAD_START_ROUTINE,void*,ULONG,ULONG_PTR,SIZE_T,SIZE_T,PS_ATTRIBUTE_LIST*);
NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE); NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
NTSYSAPI NTSTATUS WINAPI NtCreateToken(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,TOKEN_TYPE,PLUID,PLARGE_INTEGER,PTOKEN_USER,PTOKEN_GROUPS,PTOKEN_PRIVILEGES,PTOKEN_OWNER,PTOKEN_PRIMARY_GROUP,PTOKEN_DEFAULT_DACL,PTOKEN_SOURCE); NTSYSAPI NTSTATUS WINAPI NtCreateToken(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,TOKEN_TYPE,PLUID,PLARGE_INTEGER,PTOKEN_USER,PTOKEN_GROUPS,PTOKEN_PRIVILEGES,PTOKEN_OWNER,PTOKEN_PRIMARY_GROUP,PTOKEN_DEFAULT_DACL,PTOKEN_SOURCE);
NTSYSAPI NTSTATUS WINAPI NtCreateTransaction(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,LPGUID,HANDLE,ULONG,ULONG,ULONG,PLARGE_INTEGER,PUNICODE_STRING);
NTSYSAPI NTSTATUS WINAPI NtCreateUserProcess(HANDLE*,HANDLE*,ACCESS_MASK,ACCESS_MASK,OBJECT_ATTRIBUTES*,OBJECT_ATTRIBUTES*,ULONG,ULONG,RTL_USER_PROCESS_PARAMETERS*,PS_CREATE_INFO*,PS_ATTRIBUTE_LIST*); NTSYSAPI NTSTATUS WINAPI NtCreateUserProcess(HANDLE*,HANDLE*,ACCESS_MASK,ACCESS_MASK,OBJECT_ATTRIBUTES*,OBJECT_ATTRIBUTES*,ULONG,ULONG,RTL_USER_PROCESS_PARAMETERS*,PS_CREATE_INFO*,PS_ATTRIBUTE_LIST*);
NTSYSAPI NTSTATUS WINAPI NtDebugActiveProcess(HANDLE,HANDLE); NTSYSAPI NTSTATUS WINAPI NtDebugActiveProcess(HANDLE,HANDLE);
NTSYSAPI NTSTATUS WINAPI NtDebugContinue(HANDLE,CLIENT_ID*,NTSTATUS); NTSYSAPI NTSTATUS WINAPI NtDebugContinue(HANDLE,CLIENT_ID*,NTSTATUS);
...@@ -4159,6 +4161,7 @@ NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T); ...@@ -4159,6 +4161,7 @@ NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG); NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
NTSYSAPI NTSTATUS WINAPI NtResumeProcess(HANDLE); NTSYSAPI NTSTATUS WINAPI NtResumeProcess(HANDLE);
NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG); NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
NTSYSAPI NTSTATUS WINAPI NtRollbackTransaction(HANDLE,BOOLEAN);
NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE); NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG); NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*); NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
......
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