ntdll: Improve debugging helper for object attributes structure.

This commit is contained in:
Alexandre Julliard 2009-02-16 11:46:44 +01:00
parent d62d6ac9c6
commit 912d98c2ae
5 changed files with 18 additions and 24 deletions

View File

@ -37,12 +37,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
#define POP_FPU(x) DO_FPU("fstpl",x)
#endif
void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *oa)
LPCSTR debugstr_ObjectAttributes(const OBJECT_ATTRIBUTES *oa)
{
if (oa)
TRACE("%p:(name=%s, attr=0x%08x, hRoot=%p, sd=%p)\n",
oa, debugstr_us(oa->ObjectName),
oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor);
if (!oa) return "<null>";
return wine_dbg_sprintf( "{name=%s, attr=0x%08x, hRoot=%p, sd=%p}\n",
debugstr_us(oa->ObjectName), oa->Attributes,
oa->RootDirectory, oa->SecurityDescriptor );
}
LPCSTR debugstr_us( const UNICODE_STRING *us )

View File

@ -63,10 +63,9 @@ NTSTATUS WINAPI NtDuplicateToken(
{
NTSTATUS status;
TRACE("(%p,0x%08x,%p,0x%08x,0x%08x,%p)\n",
ExistingToken, DesiredAccess, ObjectAttributes,
ImpersonationLevel, TokenType, NewToken);
dump_ObjectAttributes(ObjectAttributes);
TRACE("(%p,0x%08x,%s,0x%08x,0x%08x,%p)\n",
ExistingToken, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes),
ImpersonationLevel, TokenType, NewToken);
if (ObjectAttributes && ObjectAttributes->SecurityQualityOfService)
{

View File

@ -43,9 +43,9 @@ extern void wait_suspend( CONTEXT *context );
extern void WINAPI __regs_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
extern void set_cpu_context( const CONTEXT *context );
/* debug helper */
/* debug helpers */
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_wait_for_multiple_objects( UINT count, const HANDLE *handles, UINT flags,

View File

@ -332,8 +332,7 @@ NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Desir
POBJECT_ATTRIBUTES ObjectAttributes)
{
NTSTATUS ret;
TRACE("(%p,0x%08x)\n", DirectoryHandle, DesiredAccess);
dump_ObjectAttributes(ObjectAttributes);
TRACE("(%p,0x%08x,%s)\n", DirectoryHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION;
if (!ObjectAttributes) return STATUS_INVALID_PARAMETER;
@ -381,8 +380,7 @@ NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Des
POBJECT_ATTRIBUTES ObjectAttributes)
{
NTSTATUS ret;
TRACE("(%p,0x%08x)\n", DirectoryHandle, DesiredAccess);
dump_ObjectAttributes(ObjectAttributes);
TRACE("(%p,0x%08x,%s)\n", DirectoryHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
if (!DirectoryHandle) return STATUS_ACCESS_VIOLATION;
@ -489,8 +487,7 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK
IN POBJECT_ATTRIBUTES ObjectAttributes)
{
NTSTATUS ret;
TRACE("(%p,0x%08x,%p)\n",LinkHandle, DesiredAccess, ObjectAttributes);
dump_ObjectAttributes(ObjectAttributes);
TRACE("(%p,0x%08x,%s)\n",LinkHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
if (!LinkHandle) return STATUS_ACCESS_VIOLATION;
if (!ObjectAttributes) return STATUS_INVALID_PARAMETER;
@ -544,9 +541,8 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC
if (!SymbolicLinkHandle || !TargetName) return STATUS_ACCESS_VIOLATION;
if (!TargetName->Buffer) return STATUS_INVALID_PARAMETER;
TRACE("(%p,0x%08x,%p, -> %s)\n", SymbolicLinkHandle, DesiredAccess, ObjectAttributes,
debugstr_us(TargetName));
dump_ObjectAttributes(ObjectAttributes);
TRACE("(%p,0x%08x,%s -> %s)\n", SymbolicLinkHandle, DesiredAccess,
debugstr_ObjectAttributes(ObjectAttributes), debugstr_us(TargetName));
SERVER_START_REQ(create_symlink)
{

View File

@ -693,10 +693,9 @@ NTSTATUS WINAPI NtReplaceKey(
IN HANDLE Key,
IN POBJECT_ATTRIBUTES ReplacedObjectAttributes)
{
FIXME("(%p),stub!\n", Key);
dump_ObjectAttributes(ObjectAttributes);
dump_ObjectAttributes(ReplacedObjectAttributes);
return STATUS_SUCCESS;
FIXME("(%s,%p,%s),stub!\n", debugstr_ObjectAttributes(ObjectAttributes), Key,
debugstr_ObjectAttributes(ReplacedObjectAttributes) );
return STATUS_SUCCESS;
}
/******************************************************************************
* NtRestoreKey [NTDLL.@]