Commit 912d98c2 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Improve debugging helper for object attributes structure.

parent d62d6ac9
...@@ -37,12 +37,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); ...@@ -37,12 +37,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
#define POP_FPU(x) DO_FPU("fstpl",x) #define POP_FPU(x) DO_FPU("fstpl",x)
#endif #endif
void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *oa) LPCSTR debugstr_ObjectAttributes(const OBJECT_ATTRIBUTES *oa)
{ {
if (oa) if (!oa) return "<null>";
TRACE("%p:(name=%s, attr=0x%08x, hRoot=%p, sd=%p)\n", return wine_dbg_sprintf( "{name=%s, attr=0x%08x, hRoot=%p, sd=%p}\n",
oa, debugstr_us(oa->ObjectName), debugstr_us(oa->ObjectName), oa->Attributes,
oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor); oa->RootDirectory, oa->SecurityDescriptor );
} }
LPCSTR debugstr_us( const UNICODE_STRING *us ) LPCSTR debugstr_us( const UNICODE_STRING *us )
......
...@@ -63,10 +63,9 @@ NTSTATUS WINAPI NtDuplicateToken( ...@@ -63,10 +63,9 @@ NTSTATUS WINAPI NtDuplicateToken(
{ {
NTSTATUS status; NTSTATUS status;
TRACE("(%p,0x%08x,%p,0x%08x,0x%08x,%p)\n", TRACE("(%p,0x%08x,%s,0x%08x,0x%08x,%p)\n",
ExistingToken, DesiredAccess, ObjectAttributes, ExistingToken, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes),
ImpersonationLevel, TokenType, NewToken); ImpersonationLevel, TokenType, NewToken);
dump_ObjectAttributes(ObjectAttributes);
if (ObjectAttributes && ObjectAttributes->SecurityQualityOfService) if (ObjectAttributes && ObjectAttributes->SecurityQualityOfService)
{ {
......
...@@ -43,9 +43,9 @@ extern void wait_suspend( CONTEXT *context ); ...@@ -43,9 +43,9 @@ extern void wait_suspend( CONTEXT *context );
extern void WINAPI __regs_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT ); extern void WINAPI __regs_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
extern void set_cpu_context( const CONTEXT *context ); extern void set_cpu_context( const CONTEXT *context );
/* debug helper */ /* debug helpers */
extern LPCSTR debugstr_us( const UNICODE_STRING *str ); extern LPCSTR debugstr_us( const UNICODE_STRING *str );
extern void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *ObjectAttributes); extern LPCSTR debugstr_ObjectAttributes(const OBJECT_ATTRIBUTES *oa);
extern NTSTATUS NTDLL_queue_process_apc( HANDLE process, const apc_call_t *call, apc_result_t *result ); extern NTSTATUS NTDLL_queue_process_apc( HANDLE process, const apc_call_t *call, apc_result_t *result );
extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UINT flags, extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UINT flags,
......
...@@ -332,8 +332,7 @@ NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Desir ...@@ -332,8 +332,7 @@ NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Desir
POBJECT_ATTRIBUTES ObjectAttributes) POBJECT_ATTRIBUTES ObjectAttributes)
{ {
NTSTATUS ret; NTSTATUS ret;
TRACE("(%p,0x%08x)\n", DirectoryHandle, DesiredAccess); TRACE("(%p,0x%08x,%s)\n", DirectoryHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
dump_ObjectAttributes(ObjectAttributes);
if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION; if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION;
if (!ObjectAttributes) return STATUS_INVALID_PARAMETER; if (!ObjectAttributes) return STATUS_INVALID_PARAMETER;
...@@ -381,8 +380,7 @@ NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Des ...@@ -381,8 +380,7 @@ NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Des
POBJECT_ATTRIBUTES ObjectAttributes) POBJECT_ATTRIBUTES ObjectAttributes)
{ {
NTSTATUS ret; NTSTATUS ret;
TRACE("(%p,0x%08x)\n", DirectoryHandle, DesiredAccess); TRACE("(%p,0x%08x,%s)\n", DirectoryHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
dump_ObjectAttributes(ObjectAttributes);
if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION; if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION;
...@@ -489,8 +487,7 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK ...@@ -489,8 +487,7 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK
IN POBJECT_ATTRIBUTES ObjectAttributes) IN POBJECT_ATTRIBUTES ObjectAttributes)
{ {
NTSTATUS ret; NTSTATUS ret;
TRACE("(%p,0x%08x,%p)\n",LinkHandle, DesiredAccess, ObjectAttributes); TRACE("(%p,0x%08x,%s)\n",LinkHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
dump_ObjectAttributes(ObjectAttributes);
if (!LinkHandle) return STATUS_ACCESS_VIOLATION; if (!LinkHandle) return STATUS_ACCESS_VIOLATION;
if (!ObjectAttributes) return STATUS_INVALID_PARAMETER; if (!ObjectAttributes) return STATUS_INVALID_PARAMETER;
...@@ -544,9 +541,8 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC ...@@ -544,9 +541,8 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC
if (!SymbolicLinkHandle || !TargetName) return STATUS_ACCESS_VIOLATION; if (!SymbolicLinkHandle || !TargetName) return STATUS_ACCESS_VIOLATION;
if (!TargetName->Buffer) return STATUS_INVALID_PARAMETER; if (!TargetName->Buffer) return STATUS_INVALID_PARAMETER;
TRACE("(%p,0x%08x,%p, -> %s)\n", SymbolicLinkHandle, DesiredAccess, ObjectAttributes, TRACE("(%p,0x%08x,%s -> %s)\n", SymbolicLinkHandle, DesiredAccess,
debugstr_us(TargetName)); debugstr_ObjectAttributes(ObjectAttributes), debugstr_us(TargetName));
dump_ObjectAttributes(ObjectAttributes);
SERVER_START_REQ(create_symlink) SERVER_START_REQ(create_symlink)
{ {
......
...@@ -693,9 +693,8 @@ NTSTATUS WINAPI NtReplaceKey( ...@@ -693,9 +693,8 @@ NTSTATUS WINAPI NtReplaceKey(
IN HANDLE Key, IN HANDLE Key,
IN POBJECT_ATTRIBUTES ReplacedObjectAttributes) IN POBJECT_ATTRIBUTES ReplacedObjectAttributes)
{ {
FIXME("(%p),stub!\n", Key); FIXME("(%s,%p,%s),stub!\n", debugstr_ObjectAttributes(ObjectAttributes), Key,
dump_ObjectAttributes(ObjectAttributes); debugstr_ObjectAttributes(ReplacedObjectAttributes) );
dump_ObjectAttributes(ReplacedObjectAttributes);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
/****************************************************************************** /******************************************************************************
......
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